feat: tab页允许手动修改标题 新建流程改为tab页而不是弹框
This commit is contained in:
@ -165,12 +165,25 @@ export const useMultipleTabStore = defineStore({
|
||||
index !== -1 && this.tabList.splice(index, 1);
|
||||
}
|
||||
}
|
||||
this.tabList.push(route);
|
||||
const _route = Object.assign(
|
||||
{
|
||||
tabKey: route?.query?.tabKey || `tab_${Math.round(Math.random() * 1000000)}`,
|
||||
},
|
||||
route,
|
||||
);
|
||||
this.tabList.push(_route);
|
||||
}
|
||||
this.updateCacheTab();
|
||||
cacheTab && Persistent.setLocal(MULTIPLE_TABS_KEY, this.tabList);
|
||||
},
|
||||
|
||||
changeTitle(tabKey: string, title: string) {
|
||||
const tab = (this.tabList as any).find((item) => item.tabKey === tabKey);
|
||||
if (tab) {
|
||||
tab.tabTitle = title;
|
||||
}
|
||||
},
|
||||
|
||||
async closeTab(tab: RouteLocationNormalized, router: Router) {
|
||||
const close = (route: RouteLocationNormalized) => {
|
||||
const { fullPath, meta: { affix } = {} } = route;
|
||||
|
||||
Reference in New Issue
Block a user