fix(components): [menu] expand active menu item (#9069)

* fix(components): [menu] expand active menu item

* chore: update
This commit is contained in:
zz 2022-07-28 12:57:58 +08:00 committed by GitHub
parent 7da11bc2e6
commit 50da145b2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -209,7 +209,6 @@ export default defineComponent({
if (item) {
activeIndex.value = item.index
initMenu()
} else {
activeIndex.value = val
}
@ -236,6 +235,8 @@ export default defineComponent({
}
)
watch(items.value, initMenu)
let resizeStopper: UseResizeObserverReturn['stop']
watchEffect(() => {
if (props.mode === 'horizontal' && props.ellipsis)
@ -290,7 +291,6 @@ export default defineComponent({
// lifecycle
onMounted(() => {
initMenu()
if (props.mode === 'horizontal') {
new Menubar(instance.vnode.el!, nsMenu.namespace.value)
}