https://github.com/dammy001/vueaxios
Painless Axios Wrapper for vue2/3
https://github.com/dammy001/vueaxios
axios composable vue vue-axios vue2 vue3
Last synced: about 1 month ago
JSON representation
Painless Axios Wrapper for vue2/3
- Host: GitHub
- URL: https://github.com/dammy001/vueaxios
- Owner: dammy001
- License: mit
- Created: 2021-01-29T18:35:49.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-20T15:37:05.000Z (over 2 years ago)
- Last Synced: 2025-03-15T11:46:42.775Z (2 months ago)
- Topics: axios, composable, vue, vue-axios, vue2, vue3
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@damilaredev/vue-axios
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-axios
# Axios wrapper for Vue 2.x
### Install
#### NPM
```
npm i axios @damilaredev/vue-axios --save
```### Usage
```
import Vue from 'vue';
import VueAxios from '@damilaredev/vue-axios';Vue.use(VueAxios);
```#### Via NPM
###### component.vue sample
```vue
export default {
computed: {
headers() {
return {
Authorization: `************************`,
};
},
},
methods: {
getItem: function () {
this.$get({
url: `your-url`,
headers: this.headers,
success: (response) => console.log(response),
error: (error) => console.log(error),
});
},
submitItem: function () {
this.$post({
url: `your-url`,
headers: this.headers,
data: { ...data },
success: (response) => console.log(response),
error: (error) => console.log(error),
});
},
deleteItem: function (id) {
this.$_delete({
url: `your-url/${id}`,
success: (response) => console.log(response),
error: (error) => console.log(error),
});
},
},
};```
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b feature-name`
3. Commit your changes: `git commit -am 'Some commit message'`
4. Push to the branch: `git push origin feature-name`
5. Submit a pull request 😉😉## How can I thank you?
Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or Any Social Media? Spread the word!
Don't forget to [follow me on twitter](https://twitter.com/laravel00)!
Thanks!
Damilare.## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE) file for details