vue单文件组件在<script setup></script>中使用await报错
Version
3.2.26
Reproduction link
Steps to reproduce
vite+vue3项目单文件组件中使用await
What is expected?
await调用异步函数
What is actually happening?
报错
You need to use Suspense
in the parent component. In other words, move the code you have in App.vue to a another vue file, import that component in App.vue and use it like
<Suspens><MyComp/></Suspense>
Please, next time consider using the forum, the Discord server or StackOverflow for questions first. But feel free to come back and open an issue if it turns out to be a bug 🙂