1
0
mirror of https://github.com/flarum/core.git synced 2025-08-09 18:07:02 +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); super.oninit(vnode);
app.previous = app.current; app.previous = app.current;
app.current = new PageState(this.constructor); app.current = new PageState(this.constructor, { routeName: vnode.attrs.routeName });
app.drawer.hide(); app.drawer.hide();
app.modal.close(); app.modal.close();

View File

@@ -13,7 +13,11 @@ export default function mapRoutes(routes, basePath = '') {
for (const key in routes) { for (const key in routes) {
const route = routes[key]; const route = routes[key];
map[basePath + route.path] = route.component; map[basePath + route.path] = {
render() {
return m(route.component, { routeName: key });
},
};
} }
return map; return map;