fix: fix checked prop in display form
This commit is contained in:
parent
5a2174de7a
commit
98eb5206c4
|
|
@ -23,7 +23,7 @@ import {
|
||||||
PopoverContent,
|
PopoverContent,
|
||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from '@/lib/registry/default/ui/popover'
|
} from '@/lib/registry/default/ui/popover'
|
||||||
import { Calendar } from '@/lib/registry/default/ui/calendar'
|
import { Calendar } from '@/lib/registry/new-york/ui/calendar'
|
||||||
|
|
||||||
const accountForm = ref({
|
const accountForm = ref({
|
||||||
name: '',
|
name: '',
|
||||||
|
|
|
||||||
|
|
@ -16,32 +16,30 @@ const items = [
|
||||||
{
|
{
|
||||||
id: 'recents',
|
id: 'recents',
|
||||||
label: 'Recents',
|
label: 'Recents',
|
||||||
checked: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'home',
|
id: 'home',
|
||||||
label: 'Home',
|
label: 'Home',
|
||||||
checked: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'applications',
|
id: 'applications',
|
||||||
label: 'Applications',
|
label: 'Applications',
|
||||||
checked: false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'desktop',
|
id: 'desktop',
|
||||||
label: 'Desktop',
|
label: 'Desktop',
|
||||||
checked: false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'downloads',
|
id: 'downloads',
|
||||||
label: 'Downloads',
|
label: 'Downloads',
|
||||||
checked: false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'documents',
|
id: 'documents',
|
||||||
label: 'Documents',
|
label: 'Documents',
|
||||||
checked: false,
|
|
||||||
},
|
},
|
||||||
] as const
|
] as const
|
||||||
|
|
||||||
|
|
@ -87,7 +85,7 @@ async function handleSubmit() {
|
||||||
</div>
|
</div>
|
||||||
<div v-for="item in items" :key="item.id" class="pb-1">
|
<div v-for="item in items" :key="item.id" class="pb-1">
|
||||||
<div class="flex flex-row items-center space-x-3 space-y-0">
|
<div class="flex flex-row items-center space-x-3 space-y-0">
|
||||||
<Checkbox :id="item.id" v-model:checked="item.checked" :value="item.id" />
|
<Checkbox :id="item.id" :checked="displayForm.items.includes(item.id)" @change="displayForm.items.includes(item.id) ? displayForm.items.splice(displayForm.items.indexOf(item.id), 1) : displayForm.items.push(item.id)" />
|
||||||
<Label :for="item.id">{{ item.label }}</Label>
|
<Label :for="item.id">{{ item.label }}</Label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user