Commit 923ecdab3c611e84587d2890bc43031e9eaf99ff
1 parent
eb231120
fix: 修复表格编辑时 Checkbox 组件无法正常取消勾选
Showing
1 changed file
with
4 additions
and
2 deletions
src/components/Table/src/components/editable/EditableCell.vue
@@ -190,10 +190,12 @@ | @@ -190,10 +190,12 @@ | ||
190 | const component = unref(getComponent); | 190 | const component = unref(getComponent); |
191 | if (!e) { | 191 | if (!e) { |
192 | currentValueRef.value = e; | 192 | currentValueRef.value = e; |
193 | - } else if (e?.target && Reflect.has(e.target, 'value')) { | ||
194 | - currentValueRef.value = (e as ChangeEvent).target.value; | ||
195 | } else if (component === 'Checkbox') { | 193 | } else if (component === 'Checkbox') { |
196 | currentValueRef.value = (e as ChangeEvent).target.checked; | 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 | } else if (isString(e) || isBoolean(e) || isNumber(e)) { | 199 | } else if (isString(e) || isBoolean(e) || isNumber(e)) { |
198 | currentValueRef.value = e; | 200 | currentValueRef.value = e; |
199 | } | 201 | } |