提交 698d3362 编写于 作者: Cano1997's avatar Cano1997

fix: 修复分页导航激活页标识异常

上级 81bcd39f
......@@ -35,6 +35,8 @@ export const TabExpView = defineComponent({
const deactivateAll = ref(false);
const router = useRouter(proxy);
const cacheTab = ref('');
const tabExpPagesHistory: {
[page: string]: string;
} = {};
......@@ -44,7 +46,7 @@ export const TabExpView = defineComponent({
const route = useRoute(proxy);
// 标签切换前缓存当前路径
const fullPath = route.fullPath;
tabExpPagesHistory[activeTab.value] = fullPath;
tabExpPagesHistory[cacheTab.value] = fullPath;
// 找到对应分页模型并初始化分页视图模型
const embedView = c.getEmbedViewByName(name);
......@@ -72,10 +74,12 @@ export const TabExpView = defineComponent({
setTimeout(() => {
deactivateAll.value = false;
activeTab.value = name;
cacheTab.value = name;
}, 0);
} else if (!lazyList.value.includes(name)) {
lazyList.value.push(name);
activeTab.value = name;
cacheTab.value = name;
}
};
......@@ -93,6 +97,7 @@ export const TabExpView = defineComponent({
});
if (page) {
activeTab.value = page.name;
cacheTab.value = page.name;
}
}
}
......@@ -185,6 +190,7 @@ export const TabExpView = defineComponent({
lazyList,
deactivateAll,
activeTab,
cacheTab,
keyHistory,
embedViewModal,
renderDrTab,
......@@ -202,7 +208,7 @@ export const TabExpView = defineComponent({
<i-tabs
class={this.ns.e('tab')}
name={this.c.model.codeName}
model-value={this.activeTab}
v-model={this.activeTab}
on-on-click={this.onTabClick}
>
{this.renderDrTab()}
......@@ -212,8 +218,8 @@ export const TabExpView = defineComponent({
<div class={this.ns.e('route-content')}>
<router-view
// manualKey={this.c.tabExpPages[this.activeTab].key}
key={this.c.tabExpPages[this.activeTab].key}
on-neuron-init={this.c.nerve.onNeuronInit(this.activeTab)}
key={this.c.tabExpPages[this.cacheTab].key}
on-neuron-init={this.c.nerve.onNeuronInit(this.cacheTab)}
>
{({ Component }: { Component: string }) => {
return (
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册