perf: optimize ScrooX component.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<ScrollX ref="scrollX" :height="useTheme.tags.height">
|
||||
<ScrollX :class="`h-${useTheme.tags.height}`">
|
||||
<n-tag
|
||||
v-for="tag in tagsStore.tags"
|
||||
:key="tag.path"
|
||||
@@ -47,15 +47,6 @@ watch(
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
const scrollX = ref(null)
|
||||
watch(
|
||||
() => tagsStore.tags,
|
||||
async (newVal, oldVal) => {
|
||||
await nextTick()
|
||||
scrollX.value?.refreshIsOverflow(newVal.length > oldVal.length)
|
||||
}
|
||||
)
|
||||
|
||||
const handleTagClick = (path) => {
|
||||
tagsStore.setActiveTag(path)
|
||||
router.push(path)
|
||||
|
||||
Reference in New Issue
Block a user