Questions tagged [vue-router4]
190 questions
0
votes
1 answer
Vue router: redirect according to the current url
I have a link in a navbar, that leads to a page (a new component is loaded in the main but not the navbar)
and I would like that once on this page, this same link brings back to…

rahan
- 61
- 1
- 1
- 5
0
votes
0 answers
Vue Router addRoute blank at router-view
First, sorry for my bad english.
I'm learning about modular architecture / Folder By Feature in vue just like this
enter image description here
In user module I created a router like this
enter image description here
And add user's router to main…

Hendry Tanaka
- 25
- 3
0
votes
1 answer
How can I refresh a route every time it is accessed in Vue Router 4?
I have setup a route in vue-router 4 that should load a component dynamically depending on whether the user is logged in or not. I did it like this (there may be a better way?):
import Personal from '../views/Personal.vue';
import Public from…

volume one
- 6,800
- 13
- 67
- 146
0
votes
1 answer
Vue3: Nested Routes and Dynamic Layout component
Hi Vue enthusiasts out there,
I have been working on an multi-tenant application and stuck at dynamic layout problem.
Requirement: Load tenant specific layout.vue file from public folder and wrap around it.
Tried few things like…

Pavan J
- 353
- 1
- 3
- 12
0
votes
2 answers
Vue-router routes to the wrong page, the link has to add a '#' before the path
This is my home page:
and this is my blog page:
I'm using vue3, the code goes blow:
import { createRouter, createWebHashHistory } from 'vue-router';
import Home from '../views/Home.vue';
import Blogs from '../views/Blogs.vue';
const routes = [
…

刘嘉琪
- 129
- 1
- 1
- 8
0
votes
1 answer
Vue3 Redirect with dynamic property
I have this configuration in my router.ts:
{
path: "/admin/operations/job-allocation/:id",
name: "JobAllocation",
component: () =>
import(
"@/views/admin/operations/job-allocation/index.vue"
),
children: [
{
path:…

Riza Khan
- 2,712
- 4
- 18
- 42
0
votes
0 answers
Vue & Laravel problem with loading the components
I have a problem with my simple application using Vue 3, Vue router 4 & Laravel 8, my problem is that the main component is not loading I need to Ctrl + R to be able to see the main component and for the other component using Vue router nothing is…

Nadim
- 280
- 2
- 12
0
votes
1 answer
How do I display a route parameter (Vue / Firebase)
I'm creating a blog with free sewing patterns as content. I'm using route parameters to receive each blog individually. However, I'm getting a blank page when trying to retrieve its data from firebase firestore. Please help.
The blog's id appears…

Ruzna Rizvi
- 25
- 8
0
votes
1 answer
[Vue warn]: Invalid prop: type check failed for prop "productCartData". Expected Object, got String with value "[object Object]"
"cardData" sees but does not understand what elements the array consists of.
Everything works in vue-router v3.x.
My error:
[Vue warn]: Invalid prop: type check failed for prop "productCartData". Expected Object, got String with value "[object…

Adlet
- 5
- 1
- 5
0
votes
1 answer
Change route view based on route name
At the moment I am displaying google maps in a div, whenever I change route, I want to replace the view with another view. I tried to set it as below, but it doesn't work
.map-col(ref="mapCol" v-if="route.name == 'Adventure'")
.map-col(v-else)
…

Dave
- 1
- 1
- 9
- 38
0
votes
1 answer
Unexpected error when starting the router: Error: Missing required param “catchAll”
Does anyone knows why I got this warning?
[Vue Router warn]: Unexpected error when starting the router: Error: Missing required param "catchAll"
router.beforeEach((to, from, next) => {
const isAuthenticated =…

kasp3rsky
- 127
- 1
- 3
- 15
0
votes
1 answer
how to auth the user in vue 3?
I am having some issue login the user in my app using vue 3 (vue-cli) and vue-router 4
This is the router.js
import { createRouter, createWebHistory } from 'vue-router';
import store from '../store';
import AuthLayout from…

calin24
- 905
- 3
- 21
- 43
0
votes
1 answer
Setting up Vue3 Router with menu link
I have src/route/router.js in my project:
const Reservation = () => import("../components/Reservation.vue");
const Scheduler = () => import("../components/Scheduler.vue");
const routes = [
{
path: "/index.html#reservation",
name:…

GeeWhizBang
- 699
- 4
- 27
0
votes
0 answers
Vue 3 nested routes
Given the following route:
{
path: '/detail/:someId',
component: SomeDetailComponent,
name: 'some-detail',
children: [
{
path: 'dashboard',
component: DashboardComponent,
name: 'dashboard'
},
{
path: '',
redirect: { name:…

Daan
- 466
- 1
- 8
- 21
0
votes
1 answer
onBeforeEnter does not exist in vue-router@next
I am trying to switch over to vuejs3 and the new vue-router.
Now I see that beforeRouteEnter is not exposed:
// same as beforeRouteUpdate option with no access to `this`
onBeforeRouteUpdate((to, from, next) => {
// your logic
…

SPQRInc
- 162
- 4
- 23
- 64