element-plus/packages/utils/menu/menu-bar.ts

16 lines
348 B
TypeScript
Raw Normal View History

2020-07-28 17:48:40 +08:00
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