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:
committed by
Franz Liedke
parent
6ed3cb56d4
commit
2ac18a39ed
@@ -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();
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user