Skip to content

Access slotProps in script setup #8990

Discussion options

You must be logged in to vote
<script lang="ts" setup>
function foo({ text, count }) {
  return `${text} ${count}`;
}
</script>

<template>
  <MyComponent v-slot="slotProps">
    {{ foo(slotProps) }}
  </MyComponent>
<template>

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@fabianwohlfart
Comment options

@Justineo
Comment options

Answer selected by fabianwohlfart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants