Skip to content
Advertisement

Tag: vue-router

Dynamic Routing for Dynamic Components in Vue3

A dynamic component with Dynamic Routing is needed for me in Vue3. I wanted to render the component which is coming from the params (path named id) from the router.ts As you can see here in router.ts I have a dynamic parameter named as id. I wanted the same component to be rendered with the same name. For example: If

Vue-Router URL from external source always redirects to “/”

I am running Vue 2 directly off the Vue dev server. I am trying to enter a vue route (vue-router) from an external url. For some reason I don’t know, vue-router always redirects my request and handles it as if it comes from “/”, which automatically redirects to “/login” I found a similiar questions here (https://forum.vuejs.org/t/access-to-a-vue-route-from-external-link/107250) but there is no

Conditional route for children routes in VueJS

I wonder how to redirect a children route conditionally. I’ve tried many ways but none of them works. I’m using a state from the store as the condition to redirect the children routes. I’ve exported my store from the file it is in and import it in the routes.js: import store from ‘@/store’ Here is the code to handle the

Wait for axios API call in vuex to finish before continuing vue-router guard

I have a django-rest-axios-vuejs application stack for which I’m trying to do something in the vue-router. In the vue-router beforeEach guard, I’m verifying permissions and it is done by checking something in an object called me in vuex store. Everything works well except when I refresh the page. Indeed refreshing the page also clears vuex store and my beforeEach tries

Advertisement