1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 09:26:34 +02:00

Make routeName available to pages again

This commit is contained in:
Alexander Skvortsov
2020-08-27 00:32:34 -04:00
committed by Franz Liedke
parent 6ed3cb56d4
commit 2ac18a39ed
2 changed files with 6 additions and 2 deletions

View File

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

View File

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