Skip to main content

All Questions

0 votes
1 answer
6k views

Dynamic routing with static JSON in Vuejs

I have a static local JSON file which includes my content. I am using VueResources and VueRouter. My aim is, making a list component for displaying items in local JSON file. Then, if user clicks of an ...
omerkocaaga's user avatar
1 vote
1 answer
1k views

vue add total with quality from array object

In vue I am getting a request for cart item and listing data as cart items. This is json data {"cart": [ { "id": 24, "product_id": "1", "customer_id": "2", "product": { "id": 1, "...
Kobid Kunda's user avatar
1 vote
2 answers
3k views

vuejs this.$route issue with address bar

When I remove a parameter, It does not take effect in address bar. I tried following line to remove parameter from URL. delete this.$route.query[parameter_name]; See below url, Notice following ...
ghulamjafar's user avatar
2 votes
2 answers
615 views

Difference between calling new Vue() from main.js V/s calling from each and every component

I have a project where I have initialized new Vue() from main.js using #app.mounted. Thereafter I have injected all router views from each and every component into the app. Now, what I am thinking ...
sandip kakade's user avatar
4 votes
1 answer
3k views

Cancel all http requests of previous component once the route is changed

I am using Vue2 and vue-resource in which I am using an interceptor to show the pre-loader. If there are any requests which are not resolved the loader shows up. Following is the code: <template&...
Deepak's user avatar
  • 1,362
0 votes
2 answers
1k views

Why is setting Vue.http for vue-resource ignored?

I'm using Vue.js 2.3.3, Vue Resource 1.3.3, Vue Router 2.5.3, and I'm trying to set up Vue-Auth. I keep getting a console error, however, that says auth.js?b7de:487 Error (@websanova/vue-auth): vue-...
Confused One's user avatar
9 votes
1 answer
5k views

How to redirect user inside vue-resource http interceptor?

I want to redirect the user when I have an 401, but I can't access the router from this context: Vue.http.interceptors.push(function(request, next) { // continue to next interceptor next(...
thur's user avatar
  • 1,074
1 vote
1 answer
2k views

Support 2 base URL's in Vue

Is it possible to support 2 base URL's, /test/app and /app with the Vue router? The http requests also have to use the updated path for API calls. Maybe it's possible to do this with aliases in vue ...
GroovyP's user avatar
  • 808
1 vote
3 answers
2k views

Is it posible to delete `div` from template?

I have a component myHello: <temlate> <div> <h2>Hello</h1> <p>world</p> </div> </template> And main component: <h1>my ...
artem0071's user avatar
  • 2,419
12 votes
5 answers
10k views

How to use vue-resource ($http) and vue-router ($route) in a vuex store?

Before I was getting movie detail from the component's script. The function first check whether the movie ID of the store is same as of the route's param movie ID. If its same then don't get the movie ...
Benjamin Smith Max's user avatar
1 vote
1 answer
397 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 ...
arckosfr's user avatar
2 votes
1 answer
2k views

Vue-router beforeRouteEnter Vue-Resource request

I have used this link as a reference to make a request before entering a route: https://router.vuejs.org/en/advanced/data-fetching.html import Vue from 'vue' import VueResource from 'vue-resource' Vue....
Lamarck's user avatar
  • 31
1 vote
1 answer
2k 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 ...
subha.py's user avatar
  • 473
2 votes
2 answers
5k 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 ...
DokiCRO's user avatar
  • 4,715