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