Skip to content

Commit fa3dc51

Browse files
authored
Update README.md
1 parent ecfcb24 commit fa3dc51

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
11
# vue-axios
22
A small wrapper for integrating axios to Vuejs
3+
4+
## How to install:
5+
### CommonJS:
6+
```
7+
npm install --save axios vue-axios
8+
```
9+
10+
And in your entry file:
11+
```
12+
import Vue from 'vue'
13+
import axios from 'axios'
14+
import VueAxios from 'vue-axios'
15+
16+
Vue.use(VueAxios, axios)
17+
```
18+
19+
### Script:
20+
Just add 3 script in order: `vue`, `axios` and `vue-axios` to your `document`.
21+
22+
## Usage:
23+
This wrapper bind `axios` to var `Vue` or `this` if you're using single file component.
24+
25+
You can `axios` like this:
26+
```
27+
Vue.axios.get(api).then((response) => {
28+
console.log(response.data)
29+
})
30+
31+
this.axios.get(api).then((response) => {
32+
console.log(response.data)
33+
})
34+
```

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy