⚡ Uses original router
- it has benefits to use hash properly
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/env bash
|
|
||||||
set -eo pipefail # this can be harmful, see https://www.youtube.com/watch?v=4Jo3Ml53kvc
|
|
||||||
. bs/.common || {
|
|
||||||
echo 'Please run this script from the project root directory' >&2;
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
declare -r tmp=/tmp/lit-router-extended
|
|
||||||
declare -r pkg=./node_modules/@lit-labs/router
|
|
||||||
|
|
||||||
git clone git@github.com:klauss194/lit-router-extended.git --depth 1 "$tmp"
|
|
||||||
cp "$tmp"/* "$pkg"
|
|
||||||
rm -rf "$tmp"
|
|
||||||
@@ -2,7 +2,7 @@ import type { RouteConfig } from "@lit-labs/router";
|
|||||||
import { html } from "lit";
|
import { html } from "lit";
|
||||||
|
|
||||||
export const route = {
|
export const route = {
|
||||||
path: "/#/episodes",
|
path: "/episodes" as const,
|
||||||
async enter() {
|
async enter() {
|
||||||
await import("./index.js");
|
await import("./index.js");
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ export class AppCfpodcasts extends LitElement {
|
|||||||
<main>${this._routes.outlet()}</main>
|
<main>${this._routes.outlet()}</main>
|
||||||
<nav>
|
<nav>
|
||||||
<a href="${this._routes.link("/")}">Home</a>
|
<a href="${this._routes.link("/")}">Home</a>
|
||||||
<a href="${this._routes.link("/", { hash: "/episodes" })}">Episodes</a>
|
<a href="${this._routes.link(routeEpisodes.path)}">Episodes</a>
|
||||||
</nav>
|
</nav>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user