Closed skazakovstas closed 4 years ago
@skazakovstas Do you mind the settings I look at?
In VUE component
` import Vue from 'vue' import axios from 'axios' import {ProjectService} from '../../index.js'
Vue.use(axios)
const instance = axios.create({
baseURL: '/api',
timeout: 1000,
headers: {'X-Custom-Header': 'foobar'}
});
ProjectService.axios = instance
export default {
data: () => ({
all_project: [],
}),
mounted() {
/**
* Get all project on mount component
*/
ProjectService.projectGet().then(response => {
console.log(response.data)
this.all_project = response.data
})
}
}
`
This is 'import {ProjectService} from '../../index.js'
generated from spec.json file, wich is transpile in to js.
ProjectService.axios
? Shouldn't it be serviceOptions.axios
?
Yes, it worked. Thanks again.
Good afternoon. Thanks so much for a great plugin.
Help to deal with the question. I use the generated code in VUE. When I try to access the method, I get an error in the promise ("Error: please inject yourself instance like axios").
Thanks for the help