Initial commit

This commit is contained in:
Matej Glasnák committed 2022-11-21 05:42:38 +01:00
commit d76f4258f7
231 files changed
+27803

No files matched your search

+53
View File
@@ -0,0 +1,53 @@
# W / Axios
- This plugin will add axios (this.$axios) with custom functions
# Required internal plugins
- w/auth
# Installation
1. Install plugin in `main.ts`
```javascript
import axios from '@/plugins/w/axios'
const app = createApp(App)
.use(auth)
.use(axios)
```
2. Create `.env` in app root directory
3. Add `VUE_APP_WAXIOS_URL=defaultBaseUrl` to `.env`
# Examples
1. Call without authorization header
```javascript
this.$axios.get('v1/courses')
```
2. Call with authorization header
```javascript
this.$axios.get_auth('v1/courses')
```
3. Call that will return directly response.data.data
```javascript
this.$axios.get_data('v1/courses')
this.$axios.get_auth_data('v1/courses')
```
# Public functions
```javascript
async get(url: string, config?: any)
async get_data(url: string, config?: any)
async get_auth(url: string, config?: any)
async get_auth_data(url: string, config?: any)
async post(url: string, config?: any)
async post_data(url: string, config?: any)
async post_auth(url: string, config?: any)
async post_auth_data(url: string, config?: any)
async patch(url: string, config?: any)
async patch_data(url: string, config?: any)
async patch_auth(url: string, config?: any)
async patch_auth_data(url: string, config?: any)
async delete(url: string, config?: any)
async delete_data(url: string, config?: any)
async delete_auth(url: string, config?: any)
async delete_auth_data(url: string, config?: any)
```