diff --git a/js/src/common/components/Page.js b/js/src/common/components/Page.js index f260233df..16db7624f 100644 --- a/js/src/common/components/Page.js +++ b/js/src/common/components/Page.js @@ -11,7 +11,7 @@ export default class Page extends Component { super.oninit(vnode); app.previous = app.current; - app.current = new PageState(this.constructor); + app.current = new PageState(this.constructor, { routeName: vnode.attrs.routeName }); app.drawer.hide(); app.modal.close(); diff --git a/js/src/common/utils/mapRoutes.js b/js/src/common/utils/mapRoutes.js index 16c3651d9..abcf41315 100644 --- a/js/src/common/utils/mapRoutes.js +++ b/js/src/common/utils/mapRoutes.js @@ -13,7 +13,11 @@ export default function mapRoutes(routes, basePath = '') { for (const key in routes) { const route = routes[key]; - map[basePath + route.path] = route.component; + map[basePath + route.path] = { + render() { + return m(route.component, { routeName: key }); + }, + }; } return map;