main.js中有写: app.config.globalProperties.$http = axios
// vue2 的写法
methods: {
async project_list () {
const { data: res } = await this.$http.get('project_list')
this.data = res
},
现在我要换成 vue3.0 写法,把上面的代码写到setup(){}中去, vue3.0 没有this,具体怎么写,请改代码,多谢
getCurrentInstance 方法不行,getCurrentInstance 方法好象只用在开发环境中