18910140161

请问使用script setup=props, context为什么props 和 context都是not defined

顺晟科技

2022-09-03 12:50:58

174

如题, 我的组件里用了<script setup=“props, context”>但是为什么props 和 context都是not defined?


顺晟科技:

https://staging-cn.vuejs.org/api/sfc-script-setup.html#defineexpose

我做了个连接: Vue SFC Playground

因为,不是这种使用方式。

context 被拆开了,分为 useSlots、useAttrs等。

https://staging-cn.vuejs.org/api/sfc-script-setup.html#defineprops-defineemits

https://staging-cn.vuejs.org/api/sfc-script-setup.html#useslots-useattrs

感谢大佬

我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航