How to use spread operator in <script setup> Vue3
来源:1-1 课程介绍(导学 )
DanyLee
2022-01-26
输入正文
写回答
1回答
-
张轩
2022-01-27
Hi, as far as I know, there is no way to use spread operator in <setup> directly.
Alternatively, you can do:
1 use <script> without setup sugar sytanx.
setup() { return { ...useStuff() } }
2 assign to one variable.
<script setup> const stuff = useStuff() </script> <template> {{stuff.abc}} </template>
00
相似问题