perf: 优化 TagsView (#123)

This commit is contained in:
ClariS 2023-08-28 19:34:05 +08:00 committed by GitHub
parent 6b62edc323
commit 07f321ecbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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