vue-routisan
vue-routisan copied to clipboard
[2.x] Route grouping without prefix create wrong routes
What version of vue-routisan are you using?
2.1.0
Provide a short but clear description of the bug.
Currently, you're obliging groups to have a prefix. If I don't specify one, routes inside will get a double slash.
Expected behavior
We should be able to group routes only for the beforeEnter functionality.
Actual behavior
We can't group routes without specifying a prefix, otherwise it will get a dev.localhost/route//double-slashed
.
Reproduction link
https://codesandbox.io/s/m5rv397zk9
You'll be able to see the routes on browser console
Possible QuickFix
I changed the groupMerge function from util.js to
export const groupMerge = ($new, $old) => {
let prefix = mergePrefix($new, $old);
if (!prefix) {
return {
beforeEnter: mergeGuard($new, $old)
}
}
return {
beforeEnter: mergeGuard($new, $old),
prefix: prefix
};
};
It worked, but I guess that's now how you want to deal with this problem hehe.
@raniesantos
@wbgneto I've taken over the project and have already begun work on v3, which will cover this issue. Will leave this open until v3 is released.
@wbgneto – Routisan 3 Alpha has been released. I've gone ahead and forked your sandbox, showing that the issue is now resolved: https://codesandbox.io/s/vue-routisan-47-fixed-in-v3-gtxiu?file=/src/main.js
If you’d like to give it a try in a project:
$ npm i vue-routisan@next
Docs: https://vue-routisan.rockett.pw/
Going to keep this issue open until such time as v3 stable is released.