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
派生數180
提交數206
已啟用問題?
問題數81
打開的問題數5
拉請求數73
打開的拉請求數6
關閉的拉請求數10
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?