import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import api from "./api/http";

const app = createApp(App);
app.config.globalProperties.$api = api;

app.use(store).use(router).mount('#app')

使用

this.$api.get('/api')
     .then(res=> {
         console.log(res)
         if(res.code == 0){
            this.list = res.data
         }
      })
   .catch(error=>{
     console.log(error)
  })            

 

posted on 2021-06-02 08:54  巍MG  阅读(1031)  评论(0编辑  收藏  举报