@mptw/skylens-ui 1.4.105 → 1.4.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -95,13 +95,7 @@ export default defineComponent({
|
|
|
95
95
|
});
|
|
96
96
|
const isChecked = computed(() => {
|
|
97
97
|
if (Array.isArray(modelValue.value)) {
|
|
98
|
-
|
|
99
|
-
modelValue.value.forEach((v) => {
|
|
100
|
-
if (isEqual(v, value.value)) {
|
|
101
|
-
found = true;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
return found;
|
|
98
|
+
return modelValue.value.find((v) => isEqual(v, value.value));
|
|
105
99
|
}
|
|
106
100
|
return modelValue.value === trueValue.value;
|
|
107
101
|
});
|
|
@@ -111,22 +105,22 @@ export default defineComponent({
|
|
|
111
105
|
return;
|
|
112
106
|
}
|
|
113
107
|
|
|
114
|
-
const
|
|
108
|
+
const isTargetChecked = (e.target as HTMLInputElement).checked;
|
|
115
109
|
|
|
116
110
|
if (Array.isArray(modelValue.value)) {
|
|
117
111
|
let newValue = [...modelValue.value];
|
|
118
112
|
|
|
119
|
-
if (
|
|
113
|
+
if (isTargetChecked) {
|
|
120
114
|
newValue.push(value.value);
|
|
121
115
|
} else {
|
|
122
|
-
newValue = newValue.filter((v) => v
|
|
116
|
+
newValue = newValue.filter((v) => !isEqual(v, value.value));
|
|
123
117
|
}
|
|
124
118
|
|
|
125
119
|
emit("update:modelValue", newValue);
|
|
126
120
|
} else {
|
|
127
121
|
emit(
|
|
128
122
|
"update:modelValue",
|
|
129
|
-
|
|
123
|
+
isTargetChecked ? trueValue.value : falseValue.value
|
|
130
124
|
);
|
|
131
125
|
}
|
|
132
126
|
}
|