接口请求实例
使用await/async进行数据请求
async mounted() {
await this.getData()
},
methods: {
async getData() {
try {
const res = await trend();
this.list = res.data;
} catch (err) {
console.error(err);
}
},
},