Commit 923ecdab3c611e84587d2890bc43031e9eaf99ff

Authored by zuihou
1 parent eb231120

fix: 修复表格编辑时 Checkbox 组件无法正常取消勾选

src/components/Table/src/components/editable/EditableCell.vue
... ... @@ -190,10 +190,12 @@
190 190 const component = unref(getComponent);
191 191 if (!e) {
192 192 currentValueRef.value = e;
193   - } else if (e?.target && Reflect.has(e.target, 'value')) {
194   - currentValueRef.value = (e as ChangeEvent).target.value;
195 193 } else if (component === 'Checkbox') {
196 194 currentValueRef.value = (e as ChangeEvent).target.checked;
  195 + } else if (component === 'Switch') {
  196 + currentValueRef.value = e;
  197 + } else if (e?.target && Reflect.has(e.target, 'value')) {
  198 + currentValueRef.value = (e as ChangeEvent).target.value;
197 199 } else if (isString(e) || isBoolean(e) || isNumber(e)) {
198 200 currentValueRef.value = e;
199 201 }
... ...