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) => { listenerRouteChange((route) => {
addTags(route) addTags(route)
}) }, true)
watch(visible, (value) => { watch(visible, (value) => {
value ? document.body.addEventListener("click", closeMenu) : document.body.removeEventListener("click", closeMenu) value ? document.body.addEventListener("click", closeMenu) : document.body.removeEventListener("click", closeMenu)
@ -160,7 +160,6 @@ watch(visible, (value) => {
onMounted(() => { onMounted(() => {
initTags() initTags()
addTags(route)
}) })
</script> </script>