diff --git a/src/Modal.vue b/src/Modal.vue index b4cc37d..2be421c 100644 --- a/src/Modal.vue +++ b/src/Modal.vue @@ -147,8 +147,8 @@ }, window: { - width: window.innerWidth, - height: window.innerWidth + width: 0, + height: 0 }, draggableElement: false @@ -178,7 +178,7 @@ } } }, - created () { + beforeMount () { Modal.event.$on('toggle', (name, state, params) => { if (name === this.name) { if (typeof state === 'undefined') { @@ -190,13 +190,11 @@ }); window.addEventListener('resize', this.onWindowResize) + this.onWindowResize() }, beforeDestroy () { window.removeEventListener('resize', this.onWindowResize) }, - beforeMount () { - this.onWindowResize() - }, computed: { position () { const { window, modal, shift } = this