vueResource 和 axios 与后端通信对比

1.vueResource 
(1)准备工作:
import VueResource from'vue-resource'
Vue.use(VueResource);
(2)使用:日常使用get和post方法
post:
Vue 分享3
get:
Vue 分享3


(3) 详情可以去看vue-resource gitHup:---> https://github.com/pagekit/vue-resource/blob/develop/docs/http.md

2.axios
(1)准备工作
import Axios from'axios'
Vue.prototype.$axios = Axios
(2)使用:日常的get和post请求(这里函数需要bind(this)否则没法获取到vm对象)
post:
Vue 分享3

get:

Vue 分享3
(3) githup网址附上:https://github.com/mzabriskie/axios




相关文章:

  • 2021-07-09
  • 2021-12-17
  • 2021-07-15
  • 2021-04-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
猜你喜欢
  • 2021-08-26
  • 2021-12-05
  • 2021-04-17
  • 2021-07-07
  • 2021-08-18
  • 2022-02-09
  • 2022-12-23
相关资源
相似解决方案