Click for Playground
<SideSheet>
<template #activator="{ onClick, ...slotProps }">
<v-btn
v-bind="slotProps"
@click="(e: PointerEvent) => onClick(e, { id: 5, piece: {id: 4, name: 'something' } })"
class="text-none"
variant="plain"
text="Click me"
></v-btn>
</template>
<template #default="{ initialData, onClose }">
<div class="flex-fill d-flex flex-column justify-space-between h-100">
<div class="d-flex flex-column ga-3">
{{ JSON.stringify(initialData) }}
</div>
<v-btn variant="flat" color="#160616" @click="onClose()">
Close
</v-btn>
</div>
</template>
</SideSheet>
Basically I have a side sheet component where I can use a custom component for the default slot which gets access to some initialData
passed via the second parameter of the onClick
event listener prop of the activator slot.
I would like initialData
to be typed inside the default slot via the T
generic used in the onClick
function, but it doesn’t work.