Explorar el Código

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

zuihou hace 3 años
padre
commit
923ecdab3c
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      src/components/Table/src/components/editable/EditableCell.vue

+ 4 - 2
src/components/Table/src/components/editable/EditableCell.vue

@@ -190,10 +190,12 @@
         const component = unref(getComponent);
         if (!e) {
           currentValueRef.value = e;
-        } else if (e?.target && Reflect.has(e.target, 'value')) {
-          currentValueRef.value = (e as ChangeEvent).target.value;
         } else if (component === 'Checkbox') {
           currentValueRef.value = (e as ChangeEvent).target.checked;
+        } else if (component === 'Switch') {
+          currentValueRef.value = e;
+        } else if (e?.target && Reflect.has(e.target, 'value')) {
+          currentValueRef.value = (e as ChangeEvent).target.value;
         } else if (isString(e) || isBoolean(e) || isNumber(e)) {
           currentValueRef.value = e;
         }