Closed cool-delete closed 3 years ago
export const http = axios.create({ baseURL: 'http://localhost:4000', timeout: 10000, // headers:{"X-Requested-With":"XMLHttpRequest"}, withCredentials: false
}) export default { http, install(app: App) { app.config.globalProperties.$http = http } }
Use provide / inject, see: https://v3.vuejs.org/guide/composition-api-provide-inject.html
Please ask TS question to Vue Discord.
export const http = axios.create({ baseURL: 'http://localhost:4000', timeout: 10000, // headers:{"X-Requested-With":"XMLHttpRequest"}, withCredentials: false
}) export default { http, install(app: App) { app.config.globalProperties.$http = http } }