Some questions about useSlots
api
#6193
Unanswered
alexzhang1030
asked this question in
Help/Questions
Replies: 1 comment
-
This is expected behavior. Text.vue <script setup>
import { useSlots, h } from 'vue'
const slot = useSlots()
slot.default?.().forEach(item => {
// The `item` is a `vnode.` Although it is possible to modify `vnode`, it is not recommended to do so.
item.children = "already changed to text"
})
</script>
<template>
<slot />
</template> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i want to change component slot content on
runtime environment
, and i notice an apiuseSlots
i list six different cases
playground
Are those bugs ? or not recommend to do that?
please answer me, i really appreciate it !
Beta Was this translation helpful? Give feedback.
All reactions