How to use vue-resource - 4 common examples

To help you get started, we’ve selected a few vue-resource examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github okoala / react-redux-antd / src / api / index.js View on Github external
import Resource from 'vue-resource'

// 直接拿vue-resouce过来用,比较熟
const V = function() {}
V.util = {
  warn: console.warn,
  nextTick: () => {}
}
Resource(V)

V.http.options.emulateJSON = true

export default {
  siteInfo: V.resource('/proxy/api/site/info.json'),
  siteStats: V.resource('/proxy/api/site/stats.json'),
  nodes: V.resource('/proxy/api/nodes/all.json'),
  topicsLatest: V.resource('/proxy/api/topics/latest.json'),
  topicsHot: V.resource('/proxy/api/topics/hot.json'),
  showNode: V.resource('/proxy/api/nodes/show.json'),
  showTopic: V.resource('/proxy/api/topics/show.json'),
  showReply: V.resource('/proxy/api/replies/show.json'),
  showMember: V.resource('/proxy/api/members/show.json')
}
github denno020 / linkslist / src / utils / Ajax.js View on Github external
static get(url) {
    return Http.get(url);
  }
github denno020 / linkslist / src / utils / Ajax.js View on Github external
static post(url, data) {
    return Http.post(url, data);
  }
github denno020 / linkslist / src / utils / Ajax.js View on Github external
static put(url, data) {
    return Http.put(url, data);
  }
}

vue-resource

The HTTP client for Vue.js

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis