feat: Add useScrollTo hook

This commit is contained in:
kailong321200875
2022-02-20 09:40:08 +08:00
parent 9d926b2760
commit 7d7fd9ed64
4 changed files with 187 additions and 8 deletions

View File

@@ -53,7 +53,6 @@ export const usePermissionStore = defineStore({
// 直接读取静态路由表
routerMap = cloneDeep(asyncRouterMap)
}
console.log(routerMap)
// 动态路由404一定要放到最后面
this.addRouters = routerMap.concat([
{

View File

@@ -124,6 +124,14 @@ export const useTagsViewStore = defineStore({
})
this.addCachedView()
}
},
updateVisitedView(view: RouteLocationNormalizedLoaded) {
for (let v of this.visitedViews) {
if (v.path === view.path) {
v = Object.assign(v, view)
break
}
}
}
}
})