something went wrong when use 'useSlots()' in vue3 #12949
Answered
by
jh-leong
Nedfre
asked this question in
Help/Questions
-
i try to get the name value on SecondBox by using useSlots().default() at FirstBox.vue |
Beta Was this translation helpful? Give feedback.
Answered by
jh-leong
Feb 26, 2025
Replies: 1 comment 1 reply
-
Scoped slots work like functions passed to a child component. Since you defined a slot prop For more details: https://vuejs.org/guide/components/slots.html#scoped-slots |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Nedfre
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scoped slots work like functions passed to a child component. Since you defined a slot prop
time
, you need to pass an object as an argument when calling it: PlaygroundFor more details: https://vuejs.org/guide/components/slots.html#scoped-slots