All Questions
Tagged with vuejs2 vue-router
1,761 questions
1
vote
1
answer
37
views
Declaring object.prototype in js - VueRouter it automatically calls a method
I declared an extension method for objects by creating my own function. However, I do not call or import it anywhere. As a result, I get an exception. How can I fix this? I don't recall such behavior ...
0
votes
0
answers
36
views
Vue Router 2.6 Navigation Issue, cannot navigate back (browser button)
I’m working on a Vue.js (v. 2.6) application that uses Vue Router for navigation between different pages. After logging in, the user is redirected to the home page with the following code:
this.$...
0
votes
1
answer
49
views
Vuex and Vue Router - double condition on beforeEnter not working
I have double condition in beforeEnter and nobody can enter to right place. Is there a limit in conditions or what? :(
my code in the router file:
const routes = {
path: `${routerConfig.preRoute}/...
0
votes
1
answer
56
views
How to invoke a js function after every page is created?
In my Vue2 app, it's easy enough to call a JavaScript function in the created() method of every .vue file. Not wanting to do this in every file, am I able to invoke a JS function on creation (or mount)...
0
votes
2
answers
112
views
Handling a this.$router.replace(href); in vue 2
I am new to vue and working on vue code those before me created. So there is a lot of legacy code that is just too complex to change right now.
The vue code can be in one of two states when a user ...
0
votes
0
answers
24
views
Refreshing/Reloading after using Vue Router to redirect
In my Vue component I collect page data for jobs from Contentful. If the page data is missing I want to redirect the user back to another page (the jobs listing page). However, if I use this.$route....
1
vote
1
answer
50
views
transferring userId from one component to another using vue router
I have a list of users obtained from the api. I need to make sure that when you click on the user's name, a page with his information opens with a separate link
Component UsersList
<button @click=&...
0
votes
2
answers
120
views
Fire API call only when a Vue Router child route is hit
I am using Vue2 and vue router 3x. How can I execute a store action whenever a specific child route is hit regardless if it is hit through a button press or the browser back/forward buttons?
I need to ...
0
votes
1
answer
260
views
VueJS: Why is my child route/component only rendering after I refresh the page?
I am having trouble getting a child component to render when I click on it's parent component.
When I click on a link to go to my "settings" page, my SettingsSummaryPage is rendered, but I'd ...
0
votes
3
answers
306
views
HTML5 History Mode from vuerouter not work in production
On my Laravel and Vue.js V2 project, I've implemented Vue Router v3 with History mode. It works perfectly on my development machine. However, as soon as I switch to production, I get the error message ...
0
votes
0
answers
310
views
Migrating to Vue 3 but router view is not working
I having a vue 2 project and currently migrating it to vue 3, but the router-view is not able to render the component while the path is correct. I have check on the issue, the problem seem is because ...
0
votes
1
answer
529
views
How do I reference files located outside of the src folder in a vue project?
I have a vue application that is pulling documents from a database and writing them to a directory at the project directory level of my vue app. The folder structure looks something like this:
+---...
2
votes
1
answer
964
views
Vue router in composition api?
In Nuxt 2.16, I'm trying to access the useRouter composable with import {useRouter} from 'vue-router', as in this question, but the import leaves useRouter undefined.
When I import * as r from 'vue-...
0
votes
2
answers
2k
views
Anonymous Component in vue Route
I want to use vue-router to switch between two tabs of a side navigation (general and account), but i get <Anonymous Component> displayed in vue devtools and i don't know what i'm doing wrong.
//...
0
votes
1
answer
111
views
Vue router doesn't work with complex routes
I am making a single page application with laravel 7, vue cli 2 and vue-rotuer 3.
I have created a "router.js" file where I declare all the routes inside.
Simple routes like "/" or ...