I have a Vue JS app that uses a Vuetify checkbox. I am unable to set the initial value to checked.
<v-checkbox
v-else-if="input.type == 'checkbox'"
false-value="0"
true-value="1"
v-model="input.val"
:error-messages="form.errors[field]"
>
When input.val
is equal to 1
i expect the checkbox to start off checked. However the checkbox will not start off checked.
I have also tried adding the props:
:value="input.val" :input-value="input.val"
None of these affect the starting state of the checkbox though. If input.val
starts off as 1
, why does this box not start off checked?
<v-checkbox
v-else-if="input.type == 'checkbox'"
false-value="0"
true-value="1"
:value="input.val"
:input-value="input.val"
v-model="input.val"
:error-messages="form.errors[field]"
>
<template #label>@{{ input.hint }}</template>
</v-checkbox>