Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

组件无法正确解析 v-bind="toRefs(props)" #12325

Open
guaijie opened this issue Nov 5, 2024 · 1 comment
Open

组件无法正确解析 v-bind="toRefs(props)" #12325

guaijie opened this issue Nov 5, 2024 · 1 comment
Labels

Comments

@guaijie
Copy link
Contributor

guaijie commented Nov 5, 2024

Vue version

3.5.3

Link to minimal reproduction

https://play.vuejs.org/#eNp9Uk1v1DAQ/SuWL7tIS6JuOEVpEaAe4ABV4ehLNpkEF8e2bCcsivLfGU8+uq3aXhL7vfl4M34j/2RtMvTAc174ykkbmIfQ2xuhZWeNC2xkwdxD4w/MQVkFOQCbWONMx3aYt9vivpjOLniSxkssi3RltA/MOmM9u95q7MeIXOXs6kDcMWfB9TBfspztjrvp3ZrssD3mzjr2VGrjRspYqyz5qDC2arzQQhfpPBiOhJcAnVVlALwxVpDo4f1J6vpacMrgLL3gcqqOHP2RJOC4AMcVyBYgW9KL9KIPP/DgUW0j2+TBG427HmMHwStsIRW4HzZInEbwnBETuVIp8/cbYbSZFa9+Q/XnBfzBnyMm+J0DD24AwTculK6FMNO3P7/DGc8b2Zm6Vxj9BnkP3qg+apzDPve6RtkXcaT2KzlB6vaXvz0H0H4dKgqNkRPFC47OiNt9bfRHuVnygfKEnnCLq6uem5WpUrf4AgHL4L7DPwvsbjEcFaXH+5gz3XcncCSCng+hkzEKSnTGDGUI+eBwBmz53Lw1NFIDVS7oe7NHH85RWCVRpt3c+ZbrajnQAY9embAaLp3xp96Z/gMicTkE

Steps to reproduce

image

What is expected?

我并不清楚这是否是一个 bug,还是说这么处理是官方有意为之。如果是官方默认行为,我创建了一个讨论,并希望官方能进行支持。这一行为是符合直觉的。

props 传递过程中支持解构 refs

What is actually happening?

no response

System Info

No response

Any additional comments?

No response

@guaijie guaijie changed the title 组件无法正常解析 v-bind="toRefs(props)" 组件无法正确解析 v-bind="toRefs(props)" Nov 5, 2024
@YiMo1
Copy link

YiMo1 commented Nov 6, 2024

并不是bug,在文档中有说明到,只有顶层的ref才会在模板中自动解包。参考

在你的示例代码中,你可以将v-bind="refs"改为v-bind="props"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants