mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* refactor(style): Update Eslint to V9 and Prettier to V3 * fix: vscode color * fix: vscode color * chore: remove Useless dependence and old config file * chore: format * Merge branch 'dev' into eslintV9 * fix: fix * fix: ssr test * fix: ssr test * fix: use defineConfig * fix: prettier format and ignore docs dist * fix: index.mjs => index.js * fix: Vscode color * fix: prettier ignore global.d.ts * fix: format --------- Co-authored-by: 2586740555 <15972343+CYJ090915@user.noreply.gitee.com>
23 lines
465 B
TypeScript
23 lines
465 B
TypeScript
import MenuItem from './menu-item'
|
|
|
|
import type { RendererNode } from 'vue'
|
|
|
|
class Menu {
|
|
constructor(
|
|
public domNode: RendererNode,
|
|
namespace: string
|
|
) {
|
|
this.init(namespace)
|
|
}
|
|
init(namespace: string): void {
|
|
const menuChildren = this.domNode.childNodes
|
|
Array.from<Node>(menuChildren).forEach((child) => {
|
|
if (child.nodeType === 1) {
|
|
new MenuItem(child as HTMLElement, namespace)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
export default Menu
|