element-plus/packages/utils/menu/menu-bar.ts
2020-07-29 11:44:12 +08:00

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