Lit route links handling page refresh
From the FAQ:
_If you need to change URL programmatically you can use openPage or redirectPage_
But in reality, it's the only way to not have full page refresh by clicking on routes links in Lit.
It's on purpose or it's a bug?
This is the solution I have ended with to workaround:
`<a href="/map" @click="${($event: Event) => { openRoute($event, 'map') }}" title="map">`
```
private openRoute = (event: Event, route: "map") => {
event.preventDefault();
openPage(router, route);
}
```
1 条评论