mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
perf: 优化应用
This commit is contained in:
parent
b6b44b3782
commit
fc34ff38d3
@ -106,24 +106,26 @@ export default {
|
|||||||
case 'MICRO_APP_READY':
|
case 'MICRO_APP_READY':
|
||||||
this.handleLoad()
|
this.handleLoad()
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
this.$store.commit('microApps/update', {
|
if (message && message.supportBeforeClose) {
|
||||||
name: this.name,
|
this.$store.commit('microApps/update', {
|
||||||
data: {
|
name: this.name,
|
||||||
onBeforeClose: () => {
|
data: {
|
||||||
return new Promise(resolve => {
|
onBeforeClose: () => {
|
||||||
const message = {
|
return new Promise(resolve => {
|
||||||
id: $A.randomString(16),
|
const message = {
|
||||||
name: this.name
|
id: $A.randomString(16),
|
||||||
}
|
name: this.name
|
||||||
this.$refs.iframe.contentWindow.postMessage({
|
}
|
||||||
type: 'MICRO_APP_BEFORE_CLOSE',
|
this.$refs.iframe.contentWindow.postMessage({
|
||||||
message
|
type: 'MICRO_APP_BEFORE_CLOSE',
|
||||||
}, '*')
|
message
|
||||||
this.onBeforeClose[message.id] = resolve
|
}, '*')
|
||||||
})
|
this.onBeforeClose[message.id] = resolve
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'MICRO_APP_METHOD':
|
case 'MICRO_APP_METHOD':
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user