vue-axios

A small wrapper for integrating axios to Vuejs

Github星跟踪图

vue-axios

A small wrapper for integrating axios to Vuejs

How to install:

CommonJS:

npm install --save axios vue-axios

And in your entry file:

import Vue from 'vue'
import axios from 'axios'
import VueAxios from 'vue-axios'

Vue.use(VueAxios, axios)

Script:

Just add 3 scripts in order: vue, axios and vue-axios to your document.

Usage:

This wrapper bind axios to Vue or this if you're using single file component.

You can use axios like this:

Vue.axios.get(api).then((response) => {
  console.log(response.data)
})

this.axios.get(api).then((response) => {
  console.log(response.data)
})

this.$http.get(api).then((response) => {
  console.log(response.data)
})

Please kindly check full documention of axios too

主要指标

概览
名称与所有者imcvampire/vue-axios
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2016-10-25 07:39:39
推送于2024-06-18 15:37:24
最后一次提交2024-06-11 18:16:14
发布数30
最新版本名称3.5.2 (发布于 )
第一版名称1.1.2 (发布于 )
用户参与
星数2k
关注者数42
派生数181
提交数206
已启用问题?
问题数81
打开的问题数5
拉请求数73
打开的拉请求数6
关闭的拉请求数10
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?