mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [menu] calc slice index remove comment node (#12472)
This commit is contained in:
@@ -230,7 +230,10 @@ export default defineComponent({
|
||||
const calcSliceIndex = () => {
|
||||
if (!menu.value) return -1
|
||||
const items = Array.from(menu.value?.childNodes ?? []).filter(
|
||||
(item) => item.nodeName !== '#text' || item.nodeValue
|
||||
(item) =>
|
||||
// remove comment type node #12634
|
||||
item.nodeName !== '#comment' &&
|
||||
(item.nodeName !== '#text' || item.nodeValue)
|
||||
) as HTMLElement[]
|
||||
const moreItemWidth = 64
|
||||
const paddingLeft = Number.parseInt(
|
||||
|
||||
Reference in New Issue
Block a user