|
@@ -100,7 +100,7 @@ const state = reactive<TagsViewState>({
|
|
|
sortable: '',
|
|
|
tagsRefsIndex: 0,
|
|
|
tagsViewList: [],
|
|
|
- tagsViewRoutesList: []
|
|
|
+ tagsViewRoutesList: [],
|
|
|
});
|
|
|
// 获取用户信息配置
|
|
|
const userInfosConfig = computed(() => {
|
|
@@ -153,12 +153,12 @@ const initTagsView = async () => {
|
|
|
state.tagsViewList = await Session.get('tagsViewList');
|
|
|
} else {
|
|
|
state.tagsViewRoutesList.map((v: RouteItem) => {
|
|
|
- if (v.meta?.isAffix && !v.meta.isHide) {
|
|
|
- v.url = setTagsViewHighlight(v);
|
|
|
- state.tagsViewList.push({...v});
|
|
|
- storesKeepALiveNames.addCachedView(v);
|
|
|
- }
|
|
|
- });
|
|
|
+ if (v.meta?.isAffix && !v.meta.isHide) {
|
|
|
+ v.url = setTagsViewHighlight(v);
|
|
|
+ state.tagsViewList.push({ ...v });
|
|
|
+ storesKeepALiveNames.addCachedView(v);
|
|
|
+ }
|
|
|
+ });
|
|
|
await addTagsView(route.path, <any>route);
|
|
|
}
|
|
|
// 初始化当前元素(li)的下标
|
|
@@ -238,7 +238,7 @@ const addTagsView = (path: string, to?: any) => {
|
|
|
else item.query = to?.query ? to?.query : route.query;
|
|
|
item.url = setTagsViewHighlight(item);
|
|
|
await storesKeepALiveNames.addCachedView(item);
|
|
|
- state.tagsViewList.push({...item});
|
|
|
+ state.tagsViewList.push({ ...item });
|
|
|
await addBrowserSetSession(state.tagsViewList);
|
|
|
});
|
|
|
};
|
|
@@ -265,8 +265,8 @@ const closeCurrentTagsView = (path: string) => {
|
|
|
if (!v.meta?.isAffix) {
|
|
|
if (getThemeConfig.value.isShareTagsView ? v.path === path : v.url === path) {
|
|
|
state.tagsViewList.splice(k, 1);
|
|
|
- const fi = state.tagsViewList.filter((i: any) => i.name === v.name);
|
|
|
- if(!fi) storesKeepALiveNames.delCachedView(v); // 动态路由会有多个 如果有多个不清除缓存
|
|
|
+ const fi = state.tagsViewList.filter((i: any) => i.name === v.name);
|
|
|
+ if (!fi.length) storesKeepALiveNames.delCachedView(v); // 动态路由会有多个 如果有多个不清除缓存
|
|
|
setTimeout(() => {
|
|
|
if (state.tagsViewList.length === k && getThemeConfig.value.isShareTagsView ? state.routePath === path : state.routeActive === path) {
|
|
|
// 最后一个且高亮时
|
|
@@ -576,7 +576,7 @@ onUnmounted(() => {
|
|
|
// 取消监听布局配置开启 TagsView 共用
|
|
|
mittBus.off('openShareTagsView', () => {});
|
|
|
// 取消窗口 resize 监听
|
|
|
- window.removeEventListener('resize', onSortableResize,true);
|
|
|
+ window.removeEventListener('resize', onSortableResize, true);
|
|
|
});
|
|
|
// 页面更新时
|
|
|
onBeforeUpdate(() => {
|
|
@@ -623,7 +623,7 @@ watch(
|
|
|
&-ul {
|
|
|
list-style: none;
|
|
|
margin: 0;
|
|
|
- display: flex;
|
|
|
+ display: flex;
|
|
|
align-items: center;
|
|
|
color: var(--el-text-color-regular);
|
|
|
font-size: 12px;
|