mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-01-23 02:40:23 +08:00
commit
99dccef03f
@ -497,6 +497,16 @@
|
||||
observer.listenTo(navWrap.value, handleResize);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => tabsViewStore.signal,
|
||||
(key) => {
|
||||
if (key != '') {
|
||||
closeHandleSelect(key);
|
||||
tabsViewStore.closeSignal('');
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
navWrap,
|
||||
|
@ -16,6 +16,7 @@ export type RouteItem = Partial<RouteLocationNormalized> & {
|
||||
|
||||
export type ITabsViewState = {
|
||||
tabsList: RouteItem[]; // 标签页
|
||||
signal: string; // 关闭信号
|
||||
};
|
||||
|
||||
//保留固定路由
|
||||
@ -27,6 +28,7 @@ export const useTabsViewStore = defineStore({
|
||||
id: 'app-tabs-view',
|
||||
state: (): ITabsViewState => ({
|
||||
tabsList: [],
|
||||
signal: '',
|
||||
}),
|
||||
getters: {},
|
||||
actions: {
|
||||
@ -69,5 +71,9 @@ export const useTabsViewStore = defineStore({
|
||||
console.log(retainAffixRoute(this.tabsList));
|
||||
this.tabsList = retainAffixRoute(this.tabsList);
|
||||
},
|
||||
closeSignal(signal: string) {
|
||||
// 设置tab关闭信号, 1刷新 2关闭当前 3关闭其他 4关闭全部
|
||||
this.signal = signal;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user