vue-routisan
vue-routisan copied to clipboard
[2.x] The prefix of route is duplicated when are used inside a group
What version of vue-routisan are you using?
2.1.3 [x.x.x]
Provide a short but clear description of the bug.
The routes are adding a prefix twice when working in groups
I have created the following group:
I had to write mysite.com/trade-in/trade-in/car-information in the browser to make it work
Expected behavior
I would expect the folowing routes:
mysite.com/trade-in/car-information
mysite.com/trade-in/appraisal
mysite.com/trade-in/car-information
Actual behavior
mysite.com/trade-in/trade-in/car-information
mysite.com/trade-in/trade-in/appraisal
mysite.com/trade-in/trade-in/car-information
is it a bug or am i missing something?
The reason i am creating a group is because i am using two layouts in one prefix (/trade-in)
I made it work as i expected by removing the duplicated prefix in the children
Hi, sorry for being super late with this reply, I just now found out that my settings on this repo was set to Unwatched for some reason.
This is definitely a bug. I need to change the behavior so that .group()
and .children()
work well together, I failed to account for this situation.
@blogui91 can you recreate your routes setup with the CodeSandbox Vue template so that I can test and fix this faster?
Just in case you're unfamiliar, you can directly install npm packages here unlike codepen.
Yeah for sure, I'll do it tonight. Thank you
El mié., 7 de noviembre de 2018 13:16, Ranie Santos < [email protected]> escribió:
@blogui91 https://github.com/blogui91 can you recreate your routes setup with the CodeSandbox Vue template https://codesandbox.io/s/vue so that I can test and fix this faster?
Just in case you're unfamiliar, you can directly install npm packages here unlike codepen.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/raniesantos/vue-routisan/issues/44#issuecomment-436743478, or mute the thread https://github.com/notifications/unsubscribe-auth/AFdU9BnDtOl0S13CL0b7JLrPJuUE1vD3ks5uszGPgaJpZM4XLhzS .
Sorry for the delay I have done this https://codesandbox.io/s/pm5j2zolq7 I hope it can help.
I just fixed this issue but I'm still fixing and tweaking other things to include in the next minor release (2.2.*).
I will close this issue when I release it.
Here is the link to the edited sandbox if you would like to take a look.
I made it so that child/nested routes will never receive any options set by group()
.
Since combining Vue's nested routes and Laravel's route groups creates complicated situations, this is the best solution I have for now.
Wow, thanks a lot! No problem, with the temporal fix i did it's okay for now. So, i can wait for the next release. Just let me know when you do it, i have plans to implement this library in future projects. Best regards!
@blogui91 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.
@blogui91 Routisan 3 Alpha has been released, and this issue is now resolved by way of the rewrite. I've forked your sandbox to show this: https://codesandbox.io/s/vue-routisan-44-fixed-in-v3-mjfp5?file=/src/routes.js
If you’d like to give v3 a spin:
$ npm i vue-routisan@next
The docs are available at: https://vue-routisan.rockett.pw/
Going to keep this issue open until v3 stable is released.
Sorry my late response @mikerockett. I'll take a look right now. But just looking the example i can say it works awesome! Thank you.