docs: fix AccountForm.vue example select language empty state (#442)

This commit is contained in:
Roman Slonov 2024-03-28 20:34:39 +08:00 committed by GitHub
parent 623fe06aa6
commit c1c1f171fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,6 +17,7 @@ import {
CommandGroup, CommandGroup,
CommandInput, CommandInput,
CommandItem, CommandItem,
CommandList,
} from '@/lib/registry/default/ui/command' } from '@/lib/registry/default/ui/command'
import { Button } from '@/lib/registry/new-york/ui/button' import { Button } from '@/lib/registry/new-york/ui/button'
import { import {
@ -146,26 +147,28 @@ async function onSubmit(values: any) {
<PopoverContent class="w-[200px] p-0"> <PopoverContent class="w-[200px] p-0">
<Command> <Command>
<CommandInput placeholder="Search language..." /> <CommandInput placeholder="Search language..." />
<CommandEmpty>No framework found.</CommandEmpty> <CommandEmpty>No language found.</CommandEmpty>
<CommandGroup> <CommandList>
<CommandItem <CommandGroup>
v-for="language in languages" :key="language.value" :value="language.label" <CommandItem
@select="() => { v-for="language in languages" :key="language.value" :value="language.label"
setValues({ @select="() => {
language: language.value, setValues({
}) language: language.value,
open = false })
}" open = false
> }"
<Check >
:class="cn( <Check
'mr-2 h-4 w-4', :class="cn(
value === language.value ? 'opacity-100' : 'opacity-0', 'mr-2 h-4 w-4',
)" value === language.value ? 'opacity-100' : 'opacity-0',
/> )"
{{ language.label }} />
</CommandItem> {{ language.label }}
</CommandGroup> </CommandItem>
</CommandGroup>
</CommandList>
</Command> </Command>
</PopoverContent> </PopoverContent>
</Popover> </Popover>