Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-20 19:09:21 +08:00

fix: 优化 TagsView 后导致 tag 显示顺序错乱 (#124)

This commit is contained in:
ClariS 2023-08-29 09:05:23 +08:00 committed by GitHub
parent 07f321ecbb
commit 1ef54abc1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View File

@ -36,10 +36,7 @@ const handleLink = (item: RouteLocationMatched) => {
listenerRouteChange((route) => {
if (route.path.startsWith("/redirect/")) return
getBreadcrumb()
})
/** 初始化面包屑导航信息 */
getBreadcrumb()
}, true)
</script>
<template>

View File

@ -149,17 +149,16 @@ const closeMenu = () => {
visible.value = false
}
/** 监听路由变化 */
listenerRouteChange((route) => {
addTags(route)
}, true)
watch(visible, (value) => {
value ? document.body.addEventListener("click", closeMenu) : document.body.removeEventListener("click", closeMenu)
})
onMounted(() => {
initTags()
/** 监听路由变化 */
listenerRouteChange(async (route) => {
addTags(route)
}, true)
})
</script>