From 24ede940120e6a777e00bfdbf141facee9bfe818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=81=E9=94=90?= Date: Tue, 7 Dec 2021 14:39:18 +0800 Subject: [PATCH] chore: dispose vue version --- src/components/IFrame/IFrame.vue | 8 ++++++-- src/components/Viewer/Viewer.vue | 8 ++++++-- src/components/ViewerPageSelector.vue | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/IFrame/IFrame.vue b/src/components/IFrame/IFrame.vue index 8285613..75f3a0d 100644 --- a/src/components/IFrame/IFrame.vue +++ b/src/components/IFrame/IFrame.vue @@ -15,7 +15,9 @@ export default { beforeUpdate() { // freezing to prevent unnessessary Reactifiation of vNodes - this.iApp.children = Object.freeze(this.$slots.default) + if (this.iApp) { + this.iApp.children = Object.freeze(this.$slots.default) + } }, methods: { getContentWindow() { @@ -63,7 +65,9 @@ export default { const el = document.createElement('DIV') // we will mount or nested app to this element body.appendChild(el) - const iApp = new Vue({ + const Constructor = Vue || window.Vue + + const iApp = new Constructor({ name: 'iApp', // freezing to prevent unnessessary Reactifiation of vNodes data: { children: Object.freeze(children) }, diff --git a/src/components/Viewer/Viewer.vue b/src/components/Viewer/Viewer.vue index 76366f0..70c8f37 100644 --- a/src/components/Viewer/Viewer.vue +++ b/src/components/Viewer/Viewer.vue @@ -64,7 +64,7 @@