vue-routisan icon indicating copy to clipboard operation
vue-routisan copied to clipboard

[2.x] The prefix of route is duplicated when are used inside a group

Open blogui91 opened this issue 6 years ago • 9 comments

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: image 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 image

blogui91 avatar Oct 06 '18 20:10 blogui91

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.

raniesantos avatar Nov 06 '18 18:11 raniesantos

@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.

raniesantos avatar Nov 07 '18 19:11 raniesantos

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 .

blogui91 avatar Nov 07 '18 20:11 blogui91

Sorry for the delay I have done this https://codesandbox.io/s/pm5j2zolq7 I hope it can help.

blogui91 avatar Nov 15 '18 03:11 blogui91

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.

raniesantos avatar Nov 15 '18 11:11 raniesantos

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 avatar Nov 15 '18 17:11 blogui91

@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.

mikerockett avatar Feb 22 '20 19:02 mikerockett

@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.

mikerockett avatar Aug 16 '20 09:08 mikerockett

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.

blogui91 avatar Aug 20 '20 13:08 blogui91