chore: perf style

This commit is contained in:
vben
2020-12-09 21:23:41 +08:00
parent a0b05e7769
commit e9c28319b4
5 changed files with 39 additions and 19 deletions

View File

@@ -16,6 +16,7 @@ import { tabStore } from '/@/store/modules/tab';
import { userStore } from '/@/store/modules/user';
import { initAffixTabs, useTabsDrag } from './useMultipleTabs';
import { REDIRECT_NAME } from '/@/router/constant';
export default defineComponent({
name: 'MultipleTabs',
@@ -35,6 +36,9 @@ export default defineComponent({
watch(
() => tabStore.getLastChangeRouteState?.path,
() => {
if (tabStore.getLastChangeRouteState?.name === REDIRECT_NAME) {
return;
}
const lastChangeRoute = unref(tabStore.getLastChangeRouteState);
if (!lastChangeRoute || !userStore.getTokenState) return;
const { path, fullPath } = lastChangeRoute;