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

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@design.estate/dees-catalog',
version: '3.45.0',
version: '3.45.1',
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
}

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);