Skip to content

Commit 0bcdbae

Browse files
Router.push implemented for other pages
1 parent 51ebda0 commit 0bcdbae

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/components/app-home-page/app-home-page.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,18 @@ export class AppHome {
1515
<a href="https://stenciljs.com">stenciljs.com</a> to get started.
1616
</p>
1717
<div>
18-
<h1>Pages</h1>
19-
<a href="/web-components">StencilJS componennts</a><br/>
20-
<a href="/posts-dashboard">Posts dashboard</a>
18+
<h1>Pages</h1>
2119
</div>
20+
<button
21+
onClick={() => Router.push('/web-components')}
22+
>
23+
StencilJS componennts
24+
</button>
25+
<button
26+
onClick={() => Router.push('/posts-dashboard')}
27+
>
28+
Posts dashboard
29+
</button>
2230
<button
2331
onClick={() => Router.push('/profile/sanjeet')}
2432
>

src/components/app-root/app-root.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ export class AppRoot {
2626
<app-home-page />
2727
</Route>
2828

29-
<Route path={/^\/posts-dashboard/}>
29+
<Route
30+
path={/^\/posts-dashboard/}>
3031
<posts-dashboard></posts-dashboard>
3132
</Route>
3233

33-
<Route path={/^\/web-components/}>
34+
<Route
35+
path={/^\/web-components/ }>
3436
<web-components></web-components>
3537
</Route>
3638

0 commit comments

Comments
 (0)