VeeCheckbox checked by default
Closed this issue · 2 comments
batopa commented
I can't figure out how to properly set a VeeCheckbox as checked by default.
I'm trying with checked
attribute and with v-model:checked
but it doesn't work.
For example:
<template>
<VeeCheckbox
name="checkbox_name"
v-model:checked="modelCheckbox"
/>
</template>
<script lang="ts">
const modelCheckbox = ref(true);
</script>
Am I missing something?
BayBreezy commented
Hey @batopa ,
Thanks for pointing this out.
For the UiCheckbox
component, you would use the v-model:checked
to set the default value but for the UiVeeCheckbox
component, you would just use the regular v-model
.
I added an example to the docs just now. you can check it out here: https://ui-thing.behonbaker.com/forms/veecheckbox#default-value
batopa commented
Thanks a lot! Great having It in the documentation!