Tagged Questions
0
votes
0answers
31 views
Unknown custom element: <router-view> - did you register the component correctly
Im trying to set up routes and no components are showing which is due to this error i believe.
I've checked and there are no other router-view tags in the project, ive uninstalled vue-router and ...
0
votes
0answers
19 views
Update data in component with different content vue.js
I got 10 users (for now) in my list in sidenavigation. I show them like this:
<md-list-item class="md-inset">
<router-link exact to="/user" @click.native="saveID(row.id)">
<...
0
votes
1answer
13 views
How can I access data from a parent route into the childs route?
I have 2 route components:
1) A people product list component
2) A product detail component
The list shows the products and then there is a router-link to that product using history in the router ...
-2
votes
0answers
24 views
Problems pagination with vue and vue-router
I got a problem when building SPA with vuejs using vue-router.
Everything works great without pagination. But when i go to next page. It is not update new Route
Somebody helps me out, please!
Here ...
0
votes
1answer
21 views
Can't access Vue from js
I'm trying to create an App with Vue, and Vue-ressource
Actually i need to use ressource to made auth system by an API call.
But in my Auth.js (that i import into my login.vue) console said he can't ...
0
votes
2answers
26 views
Check if it's possible to go forward when using vue-router
I'm developing an application using Vue2 and Vue-router (version ^2.2.0) and the back and forward navigation buttons have to show if the user can go back/forward or not.
To check if the user can go ...
1
vote
2answers
40 views
Page doesn't start at the top due to height of div
I am currently working with Vuejs and routing to other pages. For my link to photos, I would like a main cover photo that covers the entire screen.
<template>
<div id="album-container"&...
0
votes
0answers
42 views
Why is my view not rendering data from my vue component?
I am trying to get a list of products from an api with a mixture of vue components and the vue-router setup. I am able to console.log data out inside the function that gets the data but I am unable to ...
0
votes
2answers
43 views
How to add event listener to <router-link> component, using “v-on:” directive? (VueJS + Vue-router)
My code doesn't work. Maybe I do something wrong? Code purpose was to generate custom event 'appSidebarInlineButtonClick' on "click" event:
<template>
<router-link
:to="to"
...
1
vote
1answer
34 views
Limitations of beforeRouteLeave?
I'm using Vue.js with vue-router, and have a question about the 'beforeRouteLeave' navigation guard. I am using it for dirty-checking of a product object in my ProductDetail component, when the user ...
1
vote
1answer
24 views
How to use router in actions.js of vuex?
This is code from main.js where I`ve configured my router
enter code here
const router = new Router({
routes,
mode: 'history',
saveScrollPosition: true
});
sync(store, router);
const ...
0
votes
1answer
38 views
Vue router - Handle query params
I have a <search-bar> component that have some dropdown that i will use as filter search. When I press the submit button i run the following code:
search() {
let query = {
status: this....
0
votes
1answer
25 views
Why onclick event doesn't work with vue-router?
i want to use vue.js with vue-router, but..
in App.vue:
<template>
<div id="app">
<hello></hello>
<router-view></router-view>
</div>
</...
0
votes
0answers
50 views
I can't pass a parameter to props with VueRouter
I'm trying to pass a parameter to a component prop with VueRouter.
My route:
const router = new VueRouter({
routes: [
{ path: '/lights/:lightid', component: LightDetail, props: true }
]
})
...
1
vote
1answer
33 views
Vue Router beforeRouteLeave doesn't stop subcomponents
I have a simple question. I just want to cancel sub-component when route changed. Here is a sample. There is a home component which is the parent. And it has a subcomponent. I just want to stop ...
0
votes
1answer
23 views
VueJS: How do I use data from main.js in my templates?
I have my Vue scope in my main.js:
new Vue({
el: '#app',
router,
template: '<App/>',
components: { App },
data: {
name: 'Levi'
}
})
and I want to use it in my template: test....
1
vote
1answer
40 views
vue-router route param to component prop?
I thought this would work:
{ path: '/course/:id', component: Course.extend({
props: { course: params.id }
}) },
Sadly, it's not that simple (it's not id either). How do I do this? (I just ...
0
votes
1answer
37 views
Declarative router link not clearing model in Vue component using VueRouter
Developing a task scheduler the path '/task?id=10' fills the component model with an async response with the task information, that works ok.
In the navigation bar I have the following router link:
&...
0
votes
0answers
40 views
Vue2 router do not work when type manually
I have such code:
created: function() {
if(!localStorage.hasOwnProperty('auth_token')) {
router.replace({name: 'login'});
} else {
if(router.history.current.name == 'login') {...
1
vote
1answer
23 views
Vue 2, Cannot reference Prop Object in template
Problem: Although from the Vue DevTools I am passing the prop correctly and the router-view component has access to the data that it needs and in the correct format, whenever I try to access any of ...
0
votes
1answer
37 views
Vuejs 2, VUEX, data-binding when editing data
I have a user profile section and Im trying to allow the user to edit their information. I am using vuex to store the user profile data and pulling it into the form. The edit form is located in a ...
0
votes
1answer
57 views
Vue $route is not defined
I'm learning Vue router. And I want to made programmatic navigation (without <router-link>).
My router and view:
router = new VueRouter({
routes: [
{path : '/videos', ...
1
vote
0answers
41 views
Vuex, vue-router and handling page reload (F5)
I'm in the process of switching over the application I'm building to be a single-page application, using vue-router and vuex. But this is my first SPA, so I'm falling foul of some newbie issues. I had ...
0
votes
1answer
46 views
How to properly fetch data from API in vuex?
I'm working on my Vue.js application and having a trouble with fetching data via API with vuex-router-sync.
As I saw in every tutorial or sample, it is common thing to dispatch the store action on ...
0
votes
1answer
101 views
Vue router - API Data not fetching on redirect
I'm building an application with JWT Login and i check if the user is logged in (when visit /) and then i redirect to Dashboard:
let routes = [
{ path: '', component: Login,
beforeEnter(...
0
votes
1answer
30 views
Faltering first steps with vue-router
I'm trying to use vue-router and I've fallen at the first hurdle. I have the following routes set up:
const router = new VueRouter({
mode: 'history',
routes: [
{path: '/', ...
1
vote
1answer
58 views
Preserve component state with vue-router?
I have a listing/detail use case, where the user can double-click an item in a product list, go to the detail screen to edit and then go back to the listing screen when they're done. I've already done ...
1
vote
1answer
50 views
Vue.js Update template from component method
I want to update a components template when a certain method of the component is called. Just like the resolve function, or the Vue.compile render option, or the v-html binding option (but then with ...
1
vote
1answer
60 views
How to create dynamic tag based on props with Vue 2
How can I make a component similar to vue-router router-link where I get the tag via props to render my template ?
<my-component tag="ul">
</my-component>
Would render:
<ul>
...
0
votes
2answers
72 views
Vue Router this.$route.router undefined
I'm trying to redirect the url using router.push({ path: 'customers', query : mergedQuery }); but I can't get a correct reference to router property.
I feel like I'm missing something in the app.js ...
1
vote
1answer
91 views
Vue.js ready() method doesn't get called in vue component
I'm using Webpack bundler to serve Vue 2.0 based frontend. The problem is that method ready in components doesn't get called. Do I need to add some extra watch on component or something like that?
My ...
1
vote
1answer
93 views
Vue Js - How to get slug from url?
let me explain with example on that I am working.My project is in laravel 5.*. I referred first and second links but no luck.
I have 2 files brand_detail.blade.php and brand_detail.js
when I open ...
0
votes
1answer
38 views
Vue router-view not rending when using router.beforeEach
I'm working with the Vue Router and I need to use the router.beforeEachcallback to determine if a certain route has been hit. The only problem with this is that when the callback is used the <...
-1
votes
0answers
25 views
transition on functional component within router-view does not work?
see jsfiddle.net/faisalhakim47/qaL09rvn/31/.
it works when one of the component is functional and the other is not functional. It is intended behaviour?
1
vote
1answer
51 views
Vue.js: vue-router subdomains
The vue-router documentation does not address this topic.
Perhaps my expectation that vue-router could handle this illustrates a fundamental misunderstanding of mine of how subdomains operate.
Could ...
1
vote
3answers
74 views
Vue: Getting the router instance in children components
I'm using Vue.js and vue-router, I'm trying to navigate on a click event.
According to vue-router documentation I should use the router.push(name) API function.
The thing is that the router is ...
0
votes
1answer
42 views
Vue 2 Laravel 5.3 Vue-router 2 Proper way to set up Vue-router
Just want to set up a simple redirection upon click on something. Not sure how to use vue-router to do such. Please find my codes below:
app.js
import VueRouter from 'vue-router';
Vue.use(VueRouter)...
1
vote
0answers
84 views
Vuejs 2 Server side rendering - not working
I've been working on making my vuejs app function well with SSR but all of my tries failed. I really need help in this.
Please note that I'm using normal js files not .vue files with es6 and require ...
1
vote
1answer
36 views
Setting the router-link to attribute with component data in Vue.js
How to inject component data in <router-link to="...">? Sample:
var data = {files: [{name: "test", path: "/test"}]};
var component = {
data: function() {
return data
},
...
0
votes
2answers
40 views
Vue.js + vue-resource + vue-router = Lexical declaration error?
When trying to use Vue.js with vue-resource and vue-router a error is shown:
ReferenceError: can't access lexical declaration `vm' before
initialization
As far a I tracked the error down it ...
1
vote
1answer
96 views
Vue router2 not catching deep nested routes
My routes has the following structure divided into several files:
export const router = new VueRouter({
mode: 'hash',
base: __dirname,
saveScrollPosition: true,
history: true,
...
0
votes
1answer
34 views
Vue-router not loading URL typed into browser
I have a Laravel 5.3 project utilizing Vue-router. I am using the <router-view></router-view> tags in a template (home.blade.php).
The only problem I am running into is that I can't seem ...
0
votes
1answer
116 views
Issue rendering child views in Vue with Vue Router
I'm having trouble getting my child views to render in Vue.
My main.js file looks like this
import DashboardProducts from './components/Dashboard/DashboardProducts'
import DashboardSettings from './...
0
votes
1answer
27 views
Why does my url keep getting changed by vue.js routing?
I have a pretty simple page right now that I'm just setting up for future development but it's kind of come to a halt now that my URL keeps getting changed.
import shipmentInformation from './...
0
votes
1answer
63 views
Disable vue-router for certain routes? Or how to run SPA backend, and non-SPA frontend?
so I'm developing a website/webapp in Laravel 5.3, and Vue 2. SEO is important, so I'm wanting to keep the frontend/crawable section of the site in Laravel + Blade, and only small non necessary ...
0
votes
0answers
41 views
Load Vue's parent component and all nested routes lazily
I have an issue with lazy loading of my nested routes!
this is my parent route:
import ChildRoutes from "app/modules/child.route”;
routes: [
{
path: '/child',
component: resolve ...
-4
votes
1answer
35 views
vue component can not get this.$router from vue-router
Vue component can not get this.$router, but get this.$route in App component, what could be wrong?
import Vue from 'vue'
import VueRouter from 'vue-router'
import App from './App.vue'
import store ...
1
vote
1answer
110 views
How to do two way binding in custom directives in Vue.js 2?
Hi I am looking for a solution for two way binding in Vue.js 2. I found a answer here about two way binding but it is in Vue.js 1. I tried to work it in Vue.js 1. But it didn't work. Can anyone help ...
2
votes
2answers
48 views
VueRouter wait for ajax is done
I am building SPA and the problem is checking if user is admin or not.
After Vue.auth.getUserInfo() I want to stop whole application and wait for API response, Vue.auth.user.isAdmin is always false ...
1
vote
2answers
29 views
v-link add linkActiveClass ,how to match routerName or (path and query)?
I have two v-link like this :
'/accountList?accountType=1': {
name: 'accountList1',
component: require('./../views/finance/accountList.vue')
},
'/accountList?accountType=2'...