From b5bc3e0122e7bcb0b1e973a5cdb2630a5dbe630b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E4=BB=99=E9=83=BD=E6=B2=A1=E7=94=A8?= <615206459@qq.com> Date: Wed, 28 Feb 2024 12:44:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/crud/components/switch/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/crud/components/switch/index.tsx b/src/plugins/crud/components/switch/index.tsx index 7c62697..6ecc38b 100644 --- a/src/plugins/crud/components/switch/index.tsx +++ b/src/plugins/crud/components/switch/index.tsx @@ -60,7 +60,10 @@ export default defineComponent({ function onChange(val: boolean | string | number) { if (props.column && props.scope) { if (val !== undefined) { - if (val === activeValue.value || val === inactiveValue.value) { + if ( + status.value === activeValue.value || + status.value === inactiveValue.value + ) { const params = { id: props.scope.id, [props.column.property]: val @@ -95,7 +98,7 @@ export default defineComponent({ return () => { return (