Skip to content

Commit 05990e6

Browse files
committed
fix few bugs
1 parent 69ea81e commit 05990e6

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

src/App.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,17 +485,17 @@
485485
<h4 class="m-2">array with uncheckedValue</h4>
486486
<div class="m-4">
487487
<b-form-checkbox
488-
id="checkbox-1"
488+
id="checkbox-2"
489489
v-model="checkboxes.statusArray"
490-
name="checkbox-1"
490+
name="checkbox-2"
491491
value="accepted"
492492
unchecked-value="not_accepted"
493493
>I accept the terms and use</b-form-checkbox
494494
>
495495
<b-form-checkbox
496-
id="checkbox-2"
496+
id="checkbox-3"
497497
v-model="checkboxes.statusArray"
498-
name="checkbox-2"
498+
name="checkbox-3"
499499
value="accepted2"
500500
unchecked-value="not_accepted2"
501501
>I accept the terms and use</b-form-checkbox

src/components/BFormCheckbox/BFormCheckbox.vue

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,19 @@ export default defineComponent({
6969
get: () => {
7070
if (props.uncheckedValue) {
7171
if (!Array.isArray(props.modelValue)) {
72-
return props.modelValue ? props.value : props.uncheckedValue
72+
return props.modelValue === props.value
7373
}
7474
return props.modelValue.indexOf(props.value) > -1
7575
}
7676
return props.modelValue
7777
},
7878
set: (newValue: any) => {
7979
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) {
8584
emitValue = props.modelValue
86-
console.log('array', emitValue, newValue)
8785
if (newValue) {
8886
if (emitValue.indexOf(props.uncheckedValue) > -1)
8987
emitValue.splice(emitValue.indexOf(props.uncheckedValue), 1)
@@ -95,7 +93,6 @@ export default defineComponent({
9593
}
9694
}
9795
}
98-
console.log(emitValue)
9996
emit('input', emitValue)
10097
emit('update:modelValue', emitValue)
10198
emit('change', emitValue)

src/components/BFormRadio/BFormRadio.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export default defineComponent({
6363
const localValue: any = computed({
6464
get: () => (Array.isArray(props.modelValue) ? props.modelValue[0] : props.modelValue),
6565
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
6768
emit('input', emitValue)
6869
emit('change', emitValue)
6970
emit('update:modelValue', emitValue)

src/components/BLink/BLink.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ export default defineComponent({
125125
tag,
126126
routerAttr,
127127
link,
128-
focus,
129-
blur,
130128
clicked,
131129
}
132130
},

0 commit comments

Comments
 (0)