Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
m1k1o
GitHub Repository: m1k1o/neko
Path: blob/master/client/src/plugins/axios.ts
1301 views
1
import { PluginObject } from 'vue'
2
import axios, { AxiosStatic } from 'axios'
3
4
declare global {
5
const $http: AxiosStatic
6
7
interface Window {
8
$http: AxiosStatic
9
}
10
}
11
12
declare module 'vue/types/vue' {
13
interface Vue {
14
$http: AxiosStatic
15
}
16
}
17
18
const plugin: PluginObject<undefined> = {
19
install(Vue) {
20
window.$http = axios
21
Vue.prototype.$http = window.$http
22
},
23
}
24
25
export default plugin
26
27