File tree Expand file tree Collapse file tree 4 files changed +11
-15
lines changed Expand file tree Collapse file tree 4 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 485
485
<h4 class =" m-2" >array with uncheckedValue</h4 >
486
486
<div class =" m-4" >
487
487
<b-form-checkbox
488
- id =" checkbox-1 "
488
+ id =" checkbox-2 "
489
489
v-model =" checkboxes.statusArray"
490
- name =" checkbox-1 "
490
+ name =" checkbox-2 "
491
491
value =" accepted"
492
492
unchecked-value =" not_accepted"
493
493
>I accept the terms and use</b-form-checkbox
494
494
>
495
495
<b-form-checkbox
496
- id =" checkbox-2 "
496
+ id =" checkbox-3 "
497
497
v-model =" checkboxes.statusArray"
498
- name =" checkbox-2 "
498
+ name =" checkbox-3 "
499
499
value =" accepted2"
500
500
unchecked-value =" not_accepted2"
501
501
>I accept the terms and use</b-form-checkbox
Original file line number Diff line number Diff line change @@ -69,21 +69,19 @@ export default defineComponent({
69
69
get : () => {
70
70
if (props .uncheckedValue ) {
71
71
if (! Array .isArray (props .modelValue )) {
72
- return props .modelValue ? props .value : props . uncheckedValue
72
+ return props .modelValue === props .value
73
73
}
74
74
return props .modelValue .indexOf (props .value ) > - 1
75
75
}
76
76
return props .modelValue
77
77
},
78
78
set : (newValue : any ) => {
79
79
let emitValue = newValue
80
- console .log (newValue )
81
- if (props .uncheckedValue ) {
82
- if (! Array .isArray (props .modelValue )) {
83
- emitValue = newValue ? props .value : props .uncheckedValue
84
- } else {
80
+ if (! Array .isArray (props .modelValue )) {
81
+ emitValue = newValue ? props .value : props .uncheckedValue
82
+ } else {
83
+ if (props .uncheckedValue ) {
85
84
emitValue = props .modelValue
86
- console .log (' array' , emitValue , newValue )
87
85
if (newValue ) {
88
86
if (emitValue .indexOf (props .uncheckedValue ) > - 1 )
89
87
emitValue .splice (emitValue .indexOf (props .uncheckedValue ), 1 )
@@ -95,7 +93,6 @@ export default defineComponent({
95
93
}
96
94
}
97
95
}
98
- console .log (emitValue )
99
96
emit (' input' , emitValue )
100
97
emit (' update:modelValue' , emitValue )
101
98
emit (' change' , emitValue )
Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ export default defineComponent({
63
63
const localValue: any = computed ({
64
64
get : () => (Array .isArray (props .modelValue ) ? props .modelValue [0 ] : props .modelValue ),
65
65
set : (newValue : any ) => {
66
- const emitValue = Array .isArray (props .modelValue ) ? [newValue ] : newValue
66
+ const value = newValue ? props .value : false
67
+ const emitValue = Array .isArray (props .modelValue ) ? [value ] : value
67
68
emit (' input' , emitValue )
68
69
emit (' change' , emitValue )
69
70
emit (' update:modelValue' , emitValue )
Original file line number Diff line number Diff line change @@ -125,8 +125,6 @@ export default defineComponent({
125
125
tag ,
126
126
routerAttr ,
127
127
link ,
128
- focus ,
129
- blur ,
130
128
clicked ,
131
129
}
132
130
},
You can’t perform that action at this time.
0 commit comments