separator

This commit is contained in:
Jeffrey Chen 2024-09-19 17:12:10 +08:00
parent 361973dc1d
commit eb81057d2b
2 changed files with 19 additions and 19 deletions

View file

@ -181,6 +181,9 @@ export class MenuItem {
if (options.disabled) {
this.element.setAttribute("disabled", "disabled");
}
if (options.id) {
this.element.setAttribute("data-id", options.id);
}
if (options.type === "separator") {
this.element.classList.add("b3-menu__separator");
return;
@ -207,9 +210,6 @@ export class MenuItem {
}
});
}
if (options.id) {
this.element.setAttribute("data-id", options.id);
}
if (options.type === "readonly") {
this.element.classList.add("b3-menu__item--readonly");
}