【发布时间】:2021-10-13 16:03:53
【问题描述】:
您好,我想在调用 api 时调用方法或其他解决方案中的 asyncData 函数,因为我想在调用重置数据的此操作时执行 $emit
我这样做但不工作
index.vue
<template>
<my-orders
:orders="orders
@sendData="initOrders"
/>
</template>
<script>
async asyncData({ $axios }) {
const orders = await endpoint.getOrders({ $axios });
return {
orders
};
},
methods: {
async initOrders() {
await this.asyncData
},
}
</script>
请帮忙谢谢
【问题讨论】: