Selaa lähdekoodia

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

zuihou 3 vuotta sitten
vanhempi
commit
923ecdab3c
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  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;
         }