mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 01:41:20 +08:00
20 lines
389 B
TypeScript
20 lines
389 B
TypeScript
import MenuItem from './menu-item'
|
|
|
|
import type { RendererNode } from 'vue'
|
|
|
|
class Menu {
|
|
constructor(public domNode: RendererNode) {
|
|
this.init()
|
|
}
|
|
init(): void {
|
|
const menuChildren = this.domNode.childNodes
|
|
Array.from(menuChildren, (child: Node) => {
|
|
if (child.nodeType === 1) {
|
|
new MenuItem(child as HTMLElement)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
export default Menu
|