mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 18:01:24 +08:00
16 lines
348 B
TypeScript
16 lines
348 B
TypeScript
|
import MenuItem from './menu-item'
|
||
|
|
||
|
|
||
|
class Menu {
|
||
|
constructor(public domNode: Node) {
|
||
|
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
|