//main.ts里面import*asapifrom'@/api'//接口方法Vue.prototype.$api=apiApp.vue里面import{Vue,Component}from'vue-property-decorator'@ComponentexportdefaultclassAppextendsVue{publiccreated(){this.$api.getUserInfo().then(res=>{console.log(res,'res')}).catch(err=>{console.log(err,'err')})}publicmounted(){}}我在App.vue里面调用this.$api.xxx能够正常调用到api里面的方法,但是编译的时候会报错警告Property'$api'doesnotexistontype'App'.请问这个怎么回事啊?
添加回答
举报
0/150
提交
取消