Questions tagged [vue-router4]

190 questions
0
votes
0 answers

Get vueRouter version for 3 and / or 4 and above

I'd like to log (console.log) the versions of vue / vuex / vuerouter from inside my web app. I can't get my vuerouter 4# version. Anybody knows how to do it ? In version 4.0 we dont have a 'global' vueRouter object, so I can not even try…
Atonn
  • 1
  • 1
0
votes
1 answer

Vuejs 3 + Router + Axios (with Interceptor) - Push ignored

my scenario is: "axios": "^0.26.1", "vue": "^3.2.25", "vue-router": "^4.0.14" I use axios interceptor for two main things: Add a header, and refresh token logic. before add the code of the axios interceptor, the router.push("/") or…
CoDeC__
  • 93
  • 2
  • 9
0
votes
1 answer

Vue3 - Persisting state with Page refresh

I have just started using Vue3, and am trying to use vuex to manage state. when using Vue2 I would call the store each time the app loads like this: // mains.js import VueRouter from "vue-router"; import Vuex from "vuex"; import router from…
Shaun
  • 173
  • 2
  • 12
0
votes
1 answer

Some of Routs do not work in production in vue 3

I am having an issue. When I upload my production build-in server following route stops working and it is working fine locally. router/index.js import Splash from '../views/Splash.vue'; const routes = [ { path: "/", name: "Splash", …
Kishan
  • 13
  • 8
0
votes
1 answer

Vue 3 router link inside a clickable table row

Simple question. I have a router link inside a clickable table row. when I click the router link it triggers the @click event instead of triggering the router-link. How can I fix this?
Akif
  • 398
  • 9
  • 22
0
votes
1 answer

Can I use vue-router to data-bind a dropdown's value to a URL's query parameter?

I want to bind a dropdown to a query parameter in the URL, so when opening /page?dropdown=foo, I want the dropdown to have foo pre-selected and the other way round: when changing the dropdown's value to bar, to have the URL rewritten into…
theHacker
  • 3,984
  • 1
  • 19
  • 34
0
votes
1 answer

Django + VueJS3 app: remove the Hashtag(#) from url

Here is a tricky situation. I'm working on a Django project on top of which VueJS CDN is used for one application's render. It goes like www.mywebsite.com/newapp where the new app only is rendered with VueJS. The linked are handled by Vue router on…
Romain BOBOE
  • 367
  • 3
  • 10
0
votes
2 answers

How to conditionally render multiple components based on route without affecting layout in vue3

I have a navbar and two side menus which I use in multiple pages. But for a number of pages I don't want to have the side menu. I have tried using v-if with $router.name, but because I was using a grid system, the layout would break. Then also it…
MnL
  • 113
  • 9
0
votes
1 answer

Linking router-link and scrollBehavior not working - Vue 3 and Ionic 6

My navigation from a side menu to a specific link on the main page is not working with ion-router-link and scrollBehavior router/index.js const routes = [ ... { path: "/books", component: Books, }, { path: "/books/:key", …
jimmybondy
  • 2,092
  • 3
  • 21
  • 33
0
votes
1 answer

Vue Router 4 with nested children and params-only

I'd like to make my Vue 3 app, using Vue Router 4, to follow a pattern with nested children. This is my list of routes: export default VueRouter.createRouter({ history: VueRouter.createWebHashHistory(), routes: [ { name:…
chr_lt_ney
  • 65
  • 1
  • 7
0
votes
1 answer

Vue Router - Nested Routes Not Working as Expected

I'm trying to create a simple nested routing: App (root component, main navigation) Topic1 (sub-navigation) Topic1/Sub Topic2 My demo on Codesandbox has the following issues: 1. When navigating from /topic1 to /topic1/sub, I expected the…
Tim E.
  • 15
  • 5
0
votes
1 answer

Using vue-router with vuejs3 and I get this Vue warn: Component is missing template or render function

I'am trying to make a simply router with vue-router on vuejs3 and i get this warning on the first click on a link (not the others clicks): vue@next:1571 [Vue warn]: Component is missing template or render function. I use vuejs3, vue-router, vscode,…
970M
  • 3
  • 2
0
votes
0 answers

Creating multiple Vue components with internal router

Is it possible to use Vue Router to create internal navigation for components added via a for loop? ┌────────────────────────────────────────────────────────────────┐ │ Application │ │ …
obie
  • 578
  • 7
  • 23
0
votes
2 answers

How to fire an event in mount in Vuejs

I have a sidebar that you can see below: