File tree Expand file tree Collapse file tree 1 file changed +11
-29
lines changed
frontend/src/components/ui Expand file tree Collapse file tree 1 file changed +11
-29
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
22import { defineEmits , defineProps } from ' vue' ;
33
4- const emits = defineEmits <{
5- (event : ' update:checked' , checked : boolean ): void ;
6- (event : ' updateCheckboxGroup' , payload : { optionId: string ; checked: boolean }): void ;
7- }>();
8-
9- const props = defineProps <{
4+ interface Props {
105 name? : string ;
116 value? : string ;
127 checked? : boolean ;
138 disabled? : boolean ;
149 group? : boolean ;
1510 id? : string ;
16- }>({
17- name: {
18- type: String ,
19- default: ' ' ,
20- },
21- value: {
22- type: String ,
23- default: ' ' ,
24- },
25- checked: {
26- type: Boolean ,
27- default: false ,
28- },
29- disabled: {
30- type: Boolean ,
31- default: false ,
32- },
33- group: {
34- type: Boolean ,
35- default: false ,
36- },
37- });
11+ }
12+
13+ const emits = defineEmits <{
14+ (event : ' update:checked' , checked : boolean ): void ;
15+ (event : ' updateCheckboxGroup' , payload : { optionId? : string ; checked: boolean }): void ;
16+ }>();
17+
18+ const props = defineProps <Props >();
19+
3820
3921const handleClick = (event : Event ) => {
4022 const target = event .target as HTMLInputElement ;
4123 if (props .group ) {
42- emits (' updateCheckboxGroup' , { optionId: props .id ?? ' ' , checked: target .checked });
24+ emits (' updateCheckboxGroup' , { optionId: props .id , checked: target .checked });
4325 } else {
4426 emits (' update:checked' , target .checked );
4527 }
You can’t perform that action at this time.
0 commit comments