fix(dees-appui): substitute route params into URL hash when navigating

This commit is contained in:
2026-03-10 14:42:02 +00:00
parent 14e8b8c533
commit 1eeebb35e6
3 changed files with 14 additions and 3 deletions

View File

@@ -875,8 +875,13 @@ export class DeesAppui extends DeesElement {
try {
await this.loadView(view, params);
// Update URL hash
const route = view.route || viewId;
// Update URL hash (substitute params into route pattern)
let route = view.route || viewId;
if (params) {
for (const [key, val] of Object.entries(params)) {
route = route.replace(`:${key}`, val);
}
}
const newHash = `#${route}`;
if (window.location.hash !== newHash) {
window.history.pushState({ viewId }, '', newHash);