Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How Do I Watch The Routes Added By Method addroutes() ? #1955

Closed
xiaoweijiayou opened this issue Dec 27, 2017 · 3 comments
Closed

How Do I Watch The Routes Added By Method addroutes() ? #1955

xiaoweijiayou opened this issue Dec 27, 2017 · 3 comments

Comments

@xiaoweijiayou
Copy link

What problem does this feature solve?

when l add routes by addRoutes , I can not watch them by $router.options.routes, so where can I
get their value? Thank you for answer!

What does the proposed API look like?

It is simple but convenient!

@posva
Copy link
Member

posva commented Jan 1, 2018

You don't need to need to watch them as they never change.
Since you know when you add routes you can plug in your code there

Please, next time consider using the forum, the Discord server or StackOverflow for questions first. But feel free to come back and open an issue if it turns out to be a bug 🙂

@posva posva closed this as completed Jan 1, 2018
@fayt81
Copy link

fayt81 commented Mar 23, 2018

Hi @posva, it looks like you are closing all the different issues related to this problem. Possibly, it is due to the formulation of the issue. I think that the issue should be reformulated as a feature request because we need a convenient way to get all the routes (both those passed as options and those added at runtime with addRoutes API). At present, to verify if there is a particular route, I have to keep an array of my added routes in the store (and eventually merge it with the one in options). Since the information about all the routes is already present somewhere (because it is used by the router), I think that many of us just would like a convenient API to get it.

@josx
Copy link

josx commented Nov 1, 2018

I think that the router needs to handle all the routes, including the addRoutes routes.
It is ugly to mantain a separated structure to keep this type of routes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants