vue3
import { createApp } from 'vue'
import App from './App.vue'
import api from './api/api'
const app = createApp(App)
app.config.globalProperties.$api = api
app.use(api).mount('#app')
vue2 方法
import Vue from 'vue'
import App from './App.vue'
import api from './api/api'
Vue.config.productionTip = false
Vue.prototype.$api = api
new Vue({
render: h => h(App)
}).$mount('#app')