Skip to content

Commit 11eb35a

Browse files
committed
feat(FormSelect): Allow any kind of model value
1 parent 12eefe5 commit 11eb35a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/pages/select.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { UiContainer, UiFormSelect } from '#components';
33
import type { FormSelectOptions } from '#ui/types';
44
import { ref } from 'vue';
55
6-
const country = ref<string>();
6+
const country = ref<string | null>();
77
88
const optionsList: FormSelectOptions = [
9+
{ label: 'None', value: null },
910
{ label: '🇦🇷 Argentina', value: 'ar' },
1011
{ label: '🇧🇷 Brazil', value: 'br' },
1112
{ label: '🇨🇦 Canada', value: 'ca' },

src/runtime/types/formSelect.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export interface FormSelectItem {
1010
export type FormSelectOptions = Record<string, FormSelectItem[]> | FormSelectItem[];
1111

1212
export interface FormSelectProps<UiConfig = any> extends SelectRootProps, Omit<FormFieldProps, 'ui'> {
13+
defaultValue?: any;
14+
modelValue?: any;
1315
placeholder?: string;
1416

1517
prefixIcon?: string;

0 commit comments

Comments
 (0)