29 lines
762 B
JavaScript
29 lines
762 B
JavaScript
import { IgniteElement } from "../ignite-html/ignite-element.js";
|
|
import { IgniteTemplate, button, ul, slot } from "../ignite-html/ignite-template.js";
|
|
|
|
class DropdownMenu extends IgniteElement {
|
|
constructor() {
|
|
super();
|
|
}
|
|
|
|
render() {
|
|
return this.template.child(
|
|
new button().class("dropdown-toggle").attribute("data-toggle", "dropdown").child("menu click"),
|
|
new ul().class("dropdown-menu").child(
|
|
new slot(this)
|
|
)
|
|
);
|
|
}
|
|
}
|
|
|
|
class DropdownMenuTemplate extends IgniteTemplate {
|
|
constructor(...children) {
|
|
super("bt-dropdown-menu", children);
|
|
}
|
|
}
|
|
|
|
customElements.define("bt-dropdown-menu", DropdownMenu);
|
|
|
|
export {
|
|
DropdownMenuTemplate as DropdownMenu
|
|
}; |