mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-27 03:01:14 +08:00
19 lines
414 B
TypeScript
19 lines
414 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
|
|
;[].filter
|
|
.call(menuChildren, (child: Node) => child.nodeType === 1)
|
|
.forEach((child: Node) => {
|
|
new MenuItem(child as HTMLElement)
|
|
})
|
|
}
|
|
}
|
|
export default Menu
|