feat:微应用调整

This commit is contained in:
weifashi 2023-08-03 14:36:49 +08:00
parent a101feff21
commit 6cc20ce23f

View File

@ -61,6 +61,7 @@ export default {
deactivated() { deactivated() {
}, },
mounted() { mounted() {
this.appData = this.getAppData
}, },
watch: { watch: {
url(val) { url(val) {
@ -92,20 +93,15 @@ export default {
} }
}, },
immediate: true, immediate: true,
}, }
}, },
computed: { computed: {
...mapState([ ...mapState([
'userInfo', 'userInfo',
'themeMode', 'themeMode',
]) ]),
}, getAppData(){
methods: { return {
handleCreate(e) {
window.eventCenterForAppNameVite = new EventCenterForMicroApp(this.name)
},
handleBeforeMount(e) {
this.appData = {
type: 'init', type: 'init',
vues: { vues: {
Vue, Vue,
@ -123,14 +119,26 @@ export default {
userInfo: this.userInfo, userInfo: this.userInfo,
path: this.path path: this.path
} }
}
},
methods: {
handleCreate(e) {
//
window.eventCenterForAppNameVite = new EventCenterForMicroApp(this.name)
this.appData = this.getAppData
},
handleBeforeMount(e) {
//
}, },
handleMount(e) { handleMount(e) {
//
this.appData = this.data; this.appData = this.data;
if(this.path){ if(this.path){
this.appData.path = this.path this.appData.path = this.path
} }
}, },
handleUnmount(e) { handleUnmount(e) {
//
window.dispatchEvent(new Event('apps-unmount')); window.dispatchEvent(new Event('apps-unmount'));
}, },
handleError(e) { handleError(e) {