Skip to content

How should I fill in the path parameter for Nested Routes in @lit-labs/router? #3949

Closed Answered by AndrewJakubowicz
ouweiya asked this question in Q&A
Discussion options

You must be logged in to vote

The following diff will fix the sample:

@@ -7,7 +7,6 @@
   private _router = new Router(this, [
     { path: '/', render: () => html`<h1>Home</h1>` },
     { path: '/a', render: () => html`<h1>AAA</h1>` },
-    { path: '/b', render: () => html`<my-one></my-one>` },
     { path: '/b/*', render: () => html`<my-one></my-one>` },
   ]);
 
@@ -17,7 +16,7 @@
         <p class="text-red-800 bg-red-200 p-4">
           <a href="/">Home</a>
           <a href="/a">AA</a>
-          <a href="/b">BB</a>
+          <a href="/b/">BB</a>
         </p>
         ${this._router.outlet()}
       </div>
@@ -28,7 +27,7 @@
 @customElement('my-one')
 class MyOne extends LitElement {
   private _router = new Ro…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ouweiya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants