-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Dynamically add routes #888
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
Comments
There is no publi API to do this. |
The migration guide states that this is the way to add routes to already created router - https://vuejs.org/v2/guide/migration-vue-router.html#router-on-removed. Since this function seems private is there a way to achieve this ? |
Hm, that section is new to me personally. and createMatcher is definitely not an export of the VueRouter instance. You can import it, though: /ping @fnlctrl |
Yes, I saw it is compiled but it is not in the prototype. I think it will be good if this function is available so we can add new routes because I cannot find another way to do it. |
@LinusBorg Haven't read that section either.. Maybe we can add |
I agree that this may lead to inconsistencies but in my case I want to load entire vue module(s) with ajax call from a PHP backend and I don't know all routes that shall be available so I thought of registering them later. |
@nkostadinov Have you tried starting the app after the ajax call? |
By the time the dashboard loads I am not aware of the modules in order to add their routes. My idea was when the user clicks on a link to load the template, routes and script from ajax call and then navigate to the new module - this way the module becomes standalone and self registering. Currently I'm stack at adding routes. |
closed via 0e0fac9 |
Could someone give me an example how to add routes(in browser) after the object is initialized. I'm trying to use createMatcher but there is not such function.
The text was updated successfully, but these errors were encountered: