v-model usage in child/parent #16420
-
how could I use v-model in a child component to trigger a v-dialog? |
Beta Was this translation helpful? Give feedback.
Answered by
santiagoaloi
Jan 12, 2023
Replies: 1 comment
-
You can use proxiedModel in Parent Child <template>
<VDialog
:model-value="modelValue"
@update:model-value="$emit('update:modelValue', $event)">
<VBtn @click="$emit('update:modelValue', !modelValue)">
Dismiss
</VBtn>
</VDialog>
</template>
<script setup>
const props = defineProps({
modelValue: {
type: Boolean,
},
});
</script> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
adverich
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use proxiedModel in
VDialog
Parent
<myDialog v-model="dialog" />
Child