misc #22
@ -78,7 +78,10 @@ export const Router = {
|
|||||||
document.addEventListener("click", e=>
|
document.addEventListener("click", e=>
|
||||||
{
|
{
|
||||||
const t = e.target as HTMLAnchorElement;
|
const t = e.target as HTMLAnchorElement;
|
||||||
if(t.href)
|
const path = e.composedPath() as HTMLAnchorElement[];
|
||||||
|
for(let i=0; i<path.length; i++)
|
||||||
|
{
|
||||||
|
if(path[i].href)
|
||||||
{
|
{
|
||||||
const u = new URL(t.href);
|
const u = new URL(t.href);
|
||||||
if(u.origin == document.location.origin)
|
if(u.origin == document.location.origin)
|
||||||
@ -87,6 +90,8 @@ export const Router = {
|
|||||||
const parts = Router.Parse(u);
|
const parts = Router.Parse(u);
|
||||||
routeUpdate(parts.Path, parts.Params, parts.Anchor);
|
routeUpdate(parts.Path, parts.Params, parts.Anchor);
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, []);
|
}, []);
|
||||||
|
Loading…
Reference in New Issue
Block a user