vue-axios

A small wrapper for integrating axios to Vuejs

Github stars Tracking Chart

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

Main metrics

Overview
Name With Ownerimcvampire/vue-axios
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
Platform
License:MIT License
所有者活动
Created At2016-10-25 07:39:39
Pushed At2024-06-18 15:37:24
Last Commit At2024-06-11 18:16:14
Release Count30
Last Release Name3.5.2 (Posted on )
First Release Name1.1.2 (Posted on )
用户参与
Stargazers Count2k
Watchers Count42
Fork Count181
Commits Count206
Has Issues Enabled
Issues Count81
Issue Open Count5
Pull Requests Count73
Pull Requests Open Count6
Pull Requests Close Count10
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private