File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed
apps/docs/src/stories/Components
packages/core/src/components/FormSelect Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 2323 ## Examples
2424 </pre >
2525
26- <story-canvas title =" Example " >
27- <pf-form-select required >
26+ <story-canvas title =" Single value " >
27+ <pf-form-select required v-model = " value " >
2828 <pf-form-select-option value =" " label =" Please Choose" placeholder disabled />
2929 <pf-form-select-option value =" mr" label =" Mr" />
3030 <pf-form-select-option value =" miss" label =" Miss" />
4343 <pf-form-select-option value =" other" label =" Other" />
4444 </optgroup >
4545 </pf-form-select >
46+ <br >
47+ <p >Value: {{ JSON.stringify(value) }}</p >
48+ </story-canvas >
49+
50+ <story-canvas title =" Multiple value" >
51+ <pf-form-select required v-model =" values" multiple >
52+ <pf-form-select-option value =" " label =" Please Choose" placeholder disabled />
53+ <pf-form-select-option value =" white" label =" White" />
54+ <pf-form-select-option value =" black" label =" Black" />
55+ <pf-form-select-option value =" red" label =" Red" />
56+ <pf-form-select-option value =" green" label =" Green" />
57+ <pf-form-select-option value =" blue" label =" Blue" />
58+ <pf-form-select-option value =" yellow" label =" Yellow" />
59+ <pf-form-select-option value =" purple" label =" Purple" disabled />
60+ </pf-form-select >
61+ <br >
62+ <p >Values: {{ JSON.stringify(values) }}</p >
4663 </story-canvas >
4764 </doc-page >
4865</template >
66+
67+ <script setup lang="ts">
68+ import { ref , type Ref } from ' vue' ;
69+
70+ const value = ref (' ' );
71+ const values: Ref <string []> = ref ([]);
72+ </script >
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export const FormSelectOptionsKey = Symbol("FormSelectOptionsKey") as ChildrenTr
3333
3434export interface Props extends OUIAProps , /* @vue-ignore */ Omit <SelectHTMLAttributes , ' value' > {
3535 /** @model */
36- modelValue? : string | null ;
36+ modelValue? : string | string [] | null ;
3737
3838 disabled? : boolean ;
3939
@@ -66,7 +66,7 @@ const props = defineProps<Props>();
6666const ouiaProps = useOUIAProps ({id: props .ouiaId , safe: props .ouiaSafe });
6767
6868defineEmits <{
69- (name : ' update:modelValue' , value : string ): void ;
69+ (name : ' update:modelValue' , value : string | string [] ): void ;
7070}>();
7171
7272defineSlots <{
You can’t perform that action at this time.
0 commit comments