From 6cc20ce23f849fc5db127c95c6bd88ac83b21b5c Mon Sep 17 00:00:00 2001 From: weifashi <605403358@qq.com> Date: Thu, 3 Aug 2023 14:36:49 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=BE=AE=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/assets/js/components/MicroApps.vue | 26 +++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/resources/assets/js/components/MicroApps.vue b/resources/assets/js/components/MicroApps.vue index 04461c6c3..f12da50f4 100644 --- a/resources/assets/js/components/MicroApps.vue +++ b/resources/assets/js/components/MicroApps.vue @@ -61,6 +61,7 @@ export default { deactivated() { }, mounted() { + this.appData = this.getAppData }, watch: { url(val) { @@ -92,20 +93,15 @@ export default { } }, immediate: true, - }, + } }, computed: { ...mapState([ 'userInfo', 'themeMode', - ]) - }, - methods: { - handleCreate(e) { - window.eventCenterForAppNameVite = new EventCenterForMicroApp(this.name) - }, - handleBeforeMount(e) { - this.appData = { + ]), + getAppData(){ + return { type: 'init', vues: { Vue, @@ -123,14 +119,26 @@ export default { userInfo: this.userInfo, path: this.path } + } + }, + methods: { + handleCreate(e) { + // 创建前 + window.eventCenterForAppNameVite = new EventCenterForMicroApp(this.name) + this.appData = this.getAppData + }, + handleBeforeMount(e) { + // 加载前 }, handleMount(e) { + // 加载完成 this.appData = this.data; if(this.path){ this.appData.path = this.path } }, handleUnmount(e) { + // 卸载 window.dispatchEvent(new Event('apps-unmount')); }, handleError(e) {