Skip to content
Advertisement

Tag: vue-router

How to execute a function when all components are mounted

I’m using VueJS with the Vue Router and a js uniform module to modify form elements like select, checkboxes, etc to wrap these elements in a new element to improve the way we can style them. How can I efficiently execute this module after I changed route and my components are mounted? I could manually initialize the module in the

How to make routes case sensitive in Nuxt

I use nuxt.js + vue.js. I need to create case sensitivity of routers. I found the following property: caseSensitive. I’m trying to put it into nuxt.config but it doesn’t work, the transition is possible by links in upper case. If I directly change the file ~project/.nuxt/router.js, everything works correctly. Help me to figure it out. Answer Your code seems to

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

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

Advertisement