changed to new functions
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
// components/Menu.js
|
||||
import { Tag, For } from "sigpro";
|
||||
import { h, each } from "sigpro";
|
||||
|
||||
export const Menu = (props, children) => {
|
||||
children === undefined && (children = props, props = {});
|
||||
return Tag("ul", { ...props, class: `menu ${props.class ?? ''}` }, children);
|
||||
return h("ul", { ...props, class: `menu ${props.class ?? ''}` }, children);
|
||||
};
|
||||
|
||||
export const MenuItems = (props) => {
|
||||
@@ -12,14 +12,14 @@ export const MenuItems = (props) => {
|
||||
|
||||
const renderItem = (item) => {
|
||||
if (item.children) {
|
||||
return Tag("li", {}, [
|
||||
Tag("details", {}, [
|
||||
Tag("summary", {}, item.label),
|
||||
Tag("ul", {}, MenuItems({ items: item.children }))
|
||||
return h("li", {}, [
|
||||
h("details", {}, [
|
||||
h("summary", {}, item.label),
|
||||
h("ul", {}, MenuItems({ items: item.children }))
|
||||
])
|
||||
]);
|
||||
}
|
||||
return Tag("li", {}, Tag("a", {
|
||||
return h("li", {}, h("a", {
|
||||
href: item.href,
|
||||
onclick: item.onclick ? (e) => {
|
||||
if (!item.href) e.preventDefault();
|
||||
@@ -28,5 +28,5 @@ export const MenuItems = (props) => {
|
||||
}, item.label));
|
||||
};
|
||||
|
||||
return For(itemsSignal, renderItem, keyFn);
|
||||
return each(itemsSignal, renderItem, keyFn);
|
||||
};
|
||||
Reference in New Issue
Block a user