router go -- go

This commit is contained in:
2026-03-25 20:05:49 +01:00
parent dc0dd202af
commit 0521223b28
2 changed files with 6 additions and 6 deletions

View File

@@ -73,7 +73,7 @@ const Profile = (params) => {
Button( Button(
{ {
class: "btn-sm btn-outline", class: "btn-sm btn-outline",
onclick: () => $.router.go("/"), onclick: () => $.go("/"),
}, },
"Volver", "Volver",
), ),
@@ -93,8 +93,8 @@ export const App = () => {
}); });
const menuItems = [ const menuItems = [
{ label: "Inicio", onclick: () => $.router.go("/") }, { label: "Inicio", onclick: () => $.go("/") },
{ label: "Mi Perfil", onclick: () => $.router.go("/profile/42") }, { label: "Mi Perfil", onclick: () => $.go("/profile/42") },
{ label: "Ajustes", onclick: () => Toast("Ajustes no disponibles", "alert-error") }, { label: "Ajustes", onclick: () => Toast("Ajustes no disponibles", "alert-error") },
]; ];
@@ -104,7 +104,7 @@ export const App = () => {
A( A(
{ {
class: "btn btn-ghost text-xl font-black tracking-tighter", class: "btn btn-ghost text-xl font-black tracking-tighter",
onclick: () => $.router.go("/"), onclick: () => $.go("/"),
}, },
"SIGPRO", "SIGPRO",
), ),

View File

@@ -333,7 +333,7 @@
return outlet; return outlet;
}; };
$.router.go = (p) => (window.location.hash = p.replace(/^#?\/?/, "#/")); $.go = (p) => (window.location.hash = p.replace(/^#?\/?/, "#/"));
$.mount = (component, target) => { $.mount = (component, target) => {
const el = typeof target === "string" ? document.querySelector(target) : target; const el = typeof target === "string" ? document.querySelector(target) : target;