这么用
methods: {
async f() {
try {
const x = await this.$axios.get('/api');
console.log(x);
} catch(err) {
console.log(err)
}
}
这是 nuxt.js 的一个片段
这么用
methods: {
async f() {
try {
const x = await this.$axios.get('/api');
console.log(x);
} catch(err) {
console.log(err)
}
}
这是 nuxt.js 的一个片段