Access slotProps in script setup #8990
Answered
by
Shyam-Chen
fabianwohlfart
asked this question in
Help/Questions
Replies: 1 comment 3 replies
-
<script lang="ts" setup>
function foo({ text, count }) {
return `${text} ${count}`;
}
</script>
<template>
<MyComponent v-slot="slotProps">
{{ foo(slotProps) }}
</MyComponent>
<template> |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
fabianwohlfart
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Like here https://vuejs.org/guide/components/slots.html#scoped-slots
is it possible to access the slotProps in the
<script setup>
?Like so
?
Beta Was this translation helpful? Give feedback.
All reactions