Vue js does not change route – vue route does not work

main.js import Vue from ‘vue’ import App from ‘./App.vue’ import VueRouter from ‘vue-router’ //Components import Homepage from ‘./components/Homepage.vue’ import Login from ‘./components/Login.vue’ …

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 …

Vue: Using Vuex store in beforeRouteEnter hook to cancel navigation

I am trying to get vue-router to check a list of permissions, before finishing the navigation to a new route. The permissions are stored in vuex and ideally I’d want to avoid passing them as props …

Vue.js – Get current route in Vuex module

I have a namespaced vuex store that returns an entry of the store based on the parameter of the current route. import Router from ‘../../router/index’ const options = { routeIdentifier: ‘stepId’ } …

Having difficulty adding a second route

So I’m new to VueJs so excuse any mistakes I make here. I have a simple front end application, which is meant to be two pages long. There’s an index route and a game route. The game route takes a path …

Access parent component scope in b-table slot

Im using a v-slot in a so I can create a link. The first part of the link contains data from the datasource. However the querystring has a parameter that I need to include in the link….

Vue-router change query dynamically in navigation stepper

There is this project I’m working on and I’m stuck. I want when I click next step button the route becomes http://icontent.me/app/employer/make-order?step=1 and so on. I’m using Vue.js and vue-router. …

Callback function in beforeRouteEnter is not triggered

I have simple routes: /follower/:token/edit and /follower/new When I move from the first one to the second one by $router.push(‘/follower/new’) befoureRouteEnter hook is triggered but callback function inside ‘next’ function does not (problem does not exist when I go from different routes or reload page). Do you know what can be wrong? Vue: 2.5.17 Vue-router: 3.0.1 Regards Answer If you are navigating between routes using the same component – vue tries to optimize by delivering a cashed version. I’m not sure if this is what you are experiencing – but you could try to force re-instantiation by adding a key

Access LocalStorage in Middleware – NuxtJs

Well, I’m starting with nuxt and I have following routes: I want to protect the /dashboard, but only for users logged in with a token in localStorage. The simplest way I thought of doing this was by creating a /middleware/auth.js and registering it in the /dashboard/index.vue component. But I cannot access localStorage within a middleware, because LocalStorage is client-side. I have already tried to add this same check in the created() dashboard layout, but I cannot return window not set mounted() is too late, it can only check after the page has been fully assembled. So how can I achieve

How to prevent any routing before some async data (in Vuex store) has loaded?

In my application I need some data to be loaded inside the VueX store before routing starts (for example user sessions). An example of a race condition would be the following: // In routes …