Questions tagged [vue-resource]

An HTTP client plugin for Vue.js to manage web requests and responses using XMLHttpRequests or JSONP

vue-resource

vue-resource is an HTTP client plugin for Vue.js to manage web requests and responses using XMLHttpRequests or JSONP.

Features of the plugin (see README):

  • Supports the Promise API and URI Templates
  • Supports interceptors for request and response
  • Supports latest Firefox, Chrome, Safari, Opera and IE9+
  • Supports Vue 1.0 & Vue 2.0
  • Compact size 14KB (5.3KB gzipped)

vue-resource is no longer part of the official recommendation list from Vue, Though it still functions as intended and is usable.

"Potential reasons to migrate away include maintenance, universal/isomorphic support and more advanced features. - Vue JS Core Team

Resources

Related Tags

403 questions
3
votes
1 answer

Vue.js: vue-resource calling resource.save() with path parameter

I defined a vue-resource: resources.js: import Vue from 'vue' import VueResource from 'vue-resource' Vue.use(VueResource); export const Team = Vue.resource('team{/id}{/action}'); So, then if I call the get method on that resource: api =…
Alfred Huang
  • 17,654
  • 32
  • 118
  • 189
3
votes
2 answers

Configuration for vue-resource root and authorization

I'm looking at the following documentation for vue-resource that describes how to set up configuration: https://github.com/vuejs/vue-resource/blob/master/docs/config.md It says to set your headers with a common authorization value: …
Bryan Miller
  • 3,262
  • 4
  • 27
  • 51
3
votes
0 answers

Server side form validation with vue.js

I am trying to use Vue.js. My service returns ajax response when request is not validated successfully (400). The response contains invalid data field details which I want to use to mark input fields with css 'invalid' class. The vue.js form is …
marcinn
  • 1,879
  • 2
  • 22
  • 46
2
votes
0 answers

Getting "blocked by CORS policy" when posting in vue.js to flask API

I'm building the front-end of a personal project with vue.js. My back-end is a rest API in flask (flask-restful). First I had problems with cors when trying to do GET requests, that was solved using the following code: # file __init__.py from…
Wiliane Souza
  • 307
  • 2
  • 9
2
votes
3 answers

Empty MultipartFile[] when sending files from Vue to SpringBoot controller

I'm doing a program that will help me to make monthly reports and I stuck at uploading photos which I need for one kind of the reports. For some reason, it doesn't get an array in the controller. I use Springboot RestController at the backend and…
Hexronimo
  • 122
  • 1
  • 10
2
votes
2 answers

Vue JS Ajax Calls

I am trying to make the change from jQuery to Vue.js and am having some difficulty running an Ajax Call using vueresource. Below is a sample script I am using, with both jQuery and Vuejs. Both trying to access the same ajax call. The jQuery call…
StripyTiger
  • 877
  • 1
  • 14
  • 31
2
votes
2 answers

Vue-Resource + Typescript: Property 'http' does not exist on type 'VueConstructor'

I am working with Typescript on a Vue project which uses vue-resource. The project is working fine, but I am getting a typescript compiler error. Notice that I am able to use the module using this.$http in my components. I have checked this, this,…
metamemelord
  • 500
  • 1
  • 7
  • 19
2
votes
1 answer

vuejs beforeRouteEnter. Disable go to url if user is logged in

I want disable go to url "login" if user is logged in. I no use vuex. And I send ajax from method "beforeRouteEnter"(check login and maiby get data on page), but before, I go to route(I can see html component login page and url "/login") and after…
Sanya
  • 95
  • 1
  • 7
2
votes
1 answer

How to use Vue.JS & Vue-Resource in Sails.JS?

I'm new to Sails.JS and want to use Vue.JS in my views (every .ejs has a script) but I don't know the correct way to do it. If I create a script tag in the end of the view, this throws an error because Vue.JS hasn't loaded. So, I created a folder in…
learango
  • 133
  • 1
  • 7
2
votes
1 answer

How to display loaded data after page refresh in vue?

I have a component with some items and those items are loaded from api using get request method. When I click on an item I get redirected to its own page using dynamic routing: { path: '/:id', component: Item }. Clicked item is recognised using…
kabugh
  • 305
  • 1
  • 9
  • 30
2
votes
1 answer

Vue.js frontend interacting with Flask backend CORS issues due to not allowed preflight headers

I am stuck with the following error message in the Chrome browser: Failed to load http://localhost:5000/my_endpoint: Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers in preflight response. The…
TPPZ
  • 4,447
  • 10
  • 61
  • 106
2
votes
0 answers

Vue js interceptor return only the some part of responses

I get the responses from the server in the following format. { "Success":true, "StatusCode":"000", "Result":[ { "Id":"1", "Text":"Cash" }, { "Id":"1", "Text":"Check" }, …
Rasik
  • 1,961
  • 3
  • 35
  • 72
2
votes
1 answer

I got stuck with a get call Vue Js

I am using Vue.js with Element UI. I have to fill up a table yet I got stuck with the following error: Expected Array, got Object. I understand that the 'get' call is returning a single Promise object. I tried to print that object out to see how…
Red fx
  • 1,071
  • 2
  • 12
  • 26
2
votes
2 answers

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 is I should call new Vue() in each and every…
sandip kakade
  • 1,346
  • 5
  • 23
  • 49
2
votes
1 answer

How to mark latitude and longitude on Google Maps using vue js by json data obtained by ajax request?

This is my vue js script to get the json data using ajax request