forked from github/dataease
fix(xpack): 路由切换异常
This commit is contained in:
parent
67b283e737
commit
7055cd2189
@ -94,17 +94,19 @@ onMounted(async () => {
|
|||||||
} else {
|
} else {
|
||||||
distributed = wsCache.get(key)
|
distributed = wsCache.get(key)
|
||||||
}
|
}
|
||||||
|
console.log('distributed', distributed, attrs, window['DEXPack'])
|
||||||
|
|
||||||
if (distributed) {
|
if (distributed) {
|
||||||
window['Vue'] = Vue
|
|
||||||
window['Axios'] = axios
|
|
||||||
window['Pinia'] = Pinia
|
|
||||||
window['vueRouter'] = vueRouter
|
|
||||||
window['MittAll'] = useEmitt().emitter.all
|
|
||||||
window['I18n'] = i18n
|
|
||||||
if (window['DEXPack']) {
|
if (window['DEXPack']) {
|
||||||
const xpack = await window['DEXPack'].mapping[attrs.jsname]
|
const xpack = await window['DEXPack'].mapping[attrs.jsname]
|
||||||
plugin.value = xpack.default
|
plugin.value = xpack.default
|
||||||
} else {
|
} else {
|
||||||
|
window['Vue'] = Vue
|
||||||
|
window['Axios'] = axios
|
||||||
|
window['Pinia'] = Pinia
|
||||||
|
window['vueRouter'] = vueRouter
|
||||||
|
window['MittAll'] = useEmitt().emitter.all
|
||||||
|
window['I18n'] = i18n
|
||||||
loadDistributed().then(async res => {
|
loadDistributed().then(async res => {
|
||||||
new Function(res.data)()
|
new Function(res.data)()
|
||||||
const xpack = await window['DEXPack'].mapping[attrs.jsname]
|
const xpack = await window['DEXPack'].mapping[attrs.jsname]
|
||||||
@ -116,16 +118,6 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(
|
|
||||||
() => attrs.jsname,
|
|
||||||
() => {
|
|
||||||
if (window['DEXPack']) {
|
|
||||||
const xpack = window['DEXPack'].mapping[attrs.jsname]
|
|
||||||
plugin.value = xpack.default
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
const emits = defineEmits(['loadFail'])
|
const emits = defineEmits(['loadFail'])
|
||||||
defineExpose({
|
defineExpose({
|
||||||
invokeMethod
|
invokeMethod
|
||||||
@ -134,7 +126,7 @@ defineExpose({
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<component
|
<component
|
||||||
:class="attrs.jsname"
|
:key="attrs.jsname"
|
||||||
ref="pluginProxy"
|
ref="pluginProxy"
|
||||||
:is="plugin"
|
:is="plugin"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
|
Loading…
Reference in New Issue
Block a user