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
5
votes
1 answer

vue-resource and JSONP working example

I'm struggling to make JSONP request using vue-resource. Can anybody provide some working examples demonstrating the proper way of defining jsonp callback, handling the call within Vue component and so on. Thanks **EDIT:**For other fellows, let’s…
Oddomir
  • 81
  • 2
  • 10
5
votes
4 answers

CORS Post Request Fails

I built an API with the SLIM Micro-Framework. I setup some middleware that adds the CORS headers using the following code. class Cors{ public function __invoke(Request $request, Response $response, $next){ $response = $next($request,…
Jerome Carter
  • 237
  • 1
  • 4
  • 18
5
votes
1 answer

Check particular role's permission in Vue JS and Laravel 5.1 + Entrust

I am using Zizaco/entrust in Laravel 5.1. I want to explicitly give permissions to particular role by using checkboxes. This is my code: Fetching Roles: fetchRoles: function(){ this.$http.get('api/role',function(data){ …
sazanrjb
  • 138
  • 2
  • 8
5
votes
2 answers

Vue.js binding context in plugin?

I'm trying to create a simple plugin in Vue.js to wrap the vue-resource plugin to track the state of a request. function State() {} State.prototype.post = function (ctx, name, url, data, successCB, errorCB) { var options = {}; if (errorCB)…
Rob
  • 10,851
  • 21
  • 69
  • 109
5
votes
2 answers

Check if value exists in vuejs

I have data : 1,2,3,4,4,5 & my code like this:
{{display.test_id}}
My code if in php such as like this $temp_id = array(); foreach($data as $data){ if(in_array($data…
b4dQuetions
  • 1,549
  • 6
  • 18
  • 28
5
votes
3 answers

How do I get a plain array back from vuejs with a component?

I am using a call to my database to retrieve some results and pushing them onto an array. However when I console.log(this.activeBeers) I don't get an array back but instead an object. How can I get a plain array back instead of a…
Stephan-v
  • 19,255
  • 31
  • 115
  • 201
4
votes
1 answer

Send surveyjs result to API

I am trying to send surveyjs results to my API. In mounted(), I make a GET request with vue-resource, get questions from my dB and then set surveyjs. To send the results, I tried to use this.$http.post, in the surveyJS onComplete function, but I got…
victor
  • 75
  • 1
  • 7
4
votes
1 answer

Unable to send credentials in CORS request

I have an application where the Vue front-end is on a different domain than the server. Specifically, Vue is located on localhost:8080 and the server is located on localhost:4000. During successful logins, the server responds with an HttpOnly cookie…
Ege Ersoz
  • 6,461
  • 8
  • 34
  • 53
4
votes
1 answer

Where is Vue.use(VueResource) string in Laravel project?

In many tutorials about VueJS I see this example: import VueResource from 'vue-resource'; Vue.use(VueResource); But in newly created Laravel 5.3 project I found only this code (bootstrap.js file): window.Vue =…
brunen9
  • 112
  • 9
4
votes
2 answers

Vue-resource can't load express static file

So, I have a bit of a problem. Here's my server.js require('dotenv').load(); const http = require('http'); const path = require('path'); const express = require('express'); const app = express(); const server =…
Rando Hinn
  • 1,255
  • 19
  • 41
4
votes
1 answer

How to make Custom Pagination Component Using Laravel and Vue Js

I am using Laravel and Vue Js for the data listing and paginate data using vue component, without using component my code works fine but when i use component pagination bar is working but not sync with listing, Here is my Html
Madhu Sudhan Subedi
  • 469
  • 1
  • 6
  • 13
4
votes
1 answer

How to return value in VueJS Mixin

I'm currently developing a webapp in Vuejs. I created a Mixin that I can access globally which handles any request to my api: export default { data() { return { apiURL: 'http://example.com/api', timeout: 10000, }; }, …
Jordy
  • 4,719
  • 11
  • 47
  • 81
4
votes
1 answer

State not changing when unit testing VueJS and VueResource

I'm trying to test a service that I've created that makes an API call with vue-resource. The service should make the call and update the component with the new data, however in my tests it doesn't register the updated value. I'm using the same setup…
Matt Sanders
  • 370
  • 2
  • 12
4
votes
1 answer

Vue js: cannot redefine property: $url

I'm trying to use an ajax request by vue-resource to fill my data in vuejs. But when I require the vue-resource returns in console this message: Uncaught TypeError: Cannot redefine property: $url The error occurs in code: var Vue =…
3
votes
1 answer

How to dynamically change the header of a v-data-table?

I'm trying to make a v-data-table that is populated with json data (Vue + Vuetify + Vue-Resource). I can show the data without problems, but I need to change the first colum of the header to let visible what data the user is viewing actually. At…
Mateus Fernando
  • 99
  • 1
  • 4
  • 11