Fix routeName attr not being passed into pages

This commit is contained in:
Alexander Skvortsov 2020-10-15 18:14:20 -04:00
parent ccf8b2448f
commit 2e1331b1fe

View File

@ -24,11 +24,18 @@ export default class DefaultResolver {
return this.routeName + JSON.stringify(m.route.param());
}
makeAttrs(vnode) {
return {
...vnode.attrs,
routeName: this.routeName,
};
}
onmatch(args, requestedPath, route) {
return this.component;
}
render(vnode) {
return [{ ...vnode, routeName: this.routeName, key: this.makeKey() }];
return [{ ...vnode, attrs: this.makeAttrs(vnode), key: this.makeKey() }];
}
}