From 4f51794ad2e860a2d91780d971b7bd69ee324cf0 Mon Sep 17 00:00:00 2001 From: squall Date: Mon, 5 Sep 2022 10:17:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20destroy=20?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=20this=20=E4=B8=8A=E4=B8=8B=E6=96=87?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/wujie-vue2/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/wujie-vue2/index.js b/packages/wujie-vue2/index.js index 2abcf4f96..7594e0c15 100644 --- a/packages/wujie-vue2/index.js +++ b/packages/wujie-vue2/index.js @@ -30,7 +30,6 @@ const wujieVueOptions = { }, data() { return { - destroy: null, startAppQueue: Promise.resolve(), }; }, @@ -49,7 +48,7 @@ const wujieVueOptions = { execStartApp() { this.startAppQueue = this.startAppQueue.then(async () => { try { - this.destroy = await startApp({ + await startApp({ name: this.name, url: this.url, el: this.$refs.wujie, @@ -78,6 +77,9 @@ const wujieVueOptions = { } }); }, + destroy() { + destroyApp(this.name); + }, }, beforeDestroy() { bus.$offAll(this.handleEmit); From e9bb7992efd7c51c211215495bc99e13af6b477d Mon Sep 17 00:00:00 2001 From: squall Date: Mon, 5 Sep 2022 10:19:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(vue2):=20=E6=B7=BB=E5=8A=A0=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/wujie-vue2/index.js | 61 ++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/packages/wujie-vue2/index.js b/packages/wujie-vue2/index.js index 7594e0c15..5b24482b4 100644 --- a/packages/wujie-vue2/index.js +++ b/packages/wujie-vue2/index.js @@ -45,37 +45,38 @@ const wujieVueOptions = { handleEmit(event, ...args) { this.$emit(event, ...args); }, + async startApp() { + try { + await startApp({ + name: this.name, + url: this.url, + el: this.$refs.wujie, + loading: this.loading, + alive: this.alive, + fetch: this.fetch, + props: this.props, + attrs: this.attrs, + replace: this.replace, + sync: this.sync, + prefix: this.prefix, + fiber: this.fiber, + degrade: this.degrade, + plugins: this.plugins, + beforeLoad: this.beforeLoad, + beforeMount: this.beforeMount, + afterMount: this.afterMount, + beforeUnmount: this.beforeUnmount, + afterUnmount: this.afterUnmount, + activated: this.activated, + deactivated: this.deactivated, + loadError: this.loadError, + }); + } catch (error) { + console.log(error); + } + }, execStartApp() { - this.startAppQueue = this.startAppQueue.then(async () => { - try { - await startApp({ - name: this.name, - url: this.url, - el: this.$refs.wujie, - loading: this.loading, - alive: this.alive, - fetch: this.fetch, - props: this.props, - attrs: this.attrs, - replace: this.replace, - sync: this.sync, - prefix: this.prefix, - fiber: this.fiber, - degrade: this.degrade, - plugins: this.plugins, - beforeLoad: this.beforeLoad, - beforeMount: this.beforeMount, - afterMount: this.afterMount, - beforeUnmount: this.beforeUnmount, - afterUnmount: this.afterUnmount, - activated: this.activated, - deactivated: this.deactivated, - loadError: this.loadError, - }); - } catch (error) { - console.log(error); - } - }); + this.startAppQueue = this.startAppQueue.then(this.startApp); }, destroy() { destroyApp(this.name);