mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [menu] Avoid call router when index is not provided (#12206)
closed #9945
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
watchEffect,
|
||||
} from 'vue'
|
||||
import { useResizeObserver } from '@vueuse/core'
|
||||
import { isNil } from 'lodash-unified'
|
||||
import ElIcon from '@element-plus/components/icon'
|
||||
import { More } from '@element-plus/icons-vue'
|
||||
import {
|
||||
@@ -191,7 +192,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
const { index, indexPath } = menuItem
|
||||
if (index === undefined || indexPath === undefined) return
|
||||
if (isNil(index) || isNil(indexPath)) return
|
||||
|
||||
if (props.router && router) {
|
||||
const route = menuItem.route || index
|
||||
|
||||
Reference in New Issue
Block a user