docs(ComponentCode): handle two-way binding on modelValue

This commit is contained in:
Benjamin Canac
2024-09-03 12:09:08 +02:00
parent 6f4fdb163c
commit be383e415d

View File

@@ -250,7 +250,7 @@ const { data: ast } = await useAsyncData(`component-code-${name}-${JSON.stringif
</div>
<div class="flex border border-b-0 border-gray-300 dark:border-gray-700 relative p-4" :class="[!options.length && 'rounded-t-md', props.class]">
<component :is="name" v-bind="componentProps">
<component :is="name" v-bind="componentProps" @update:model-value="!!componentProps.modelValue && setComponentProp('modelValue', $event)">
<template v-for="slot in Object.keys(slots || {})" :key="slot" #[slot]>
<ContentSlot :name="slot" unwrap="p">
{{ slots[slot] }}