From a04dfc925eea739fcf09ef56a5c70ee4861f1308 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: Fri, 22 Mar 2024 11:01:06 +0800 Subject: [PATCH] =?UTF-8?q?cl-switch=20=E9=BB=98=E8=AE=A4=E5=80=BC?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/crud/components/switch/index.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/crud/components/switch/index.tsx b/src/plugins/crud/components/switch/index.tsx index 6ecc38b..331e6da 100644 --- a/src/plugins/crud/components/switch/index.tsx +++ b/src/plugins/crud/components/switch/index.tsx @@ -41,15 +41,16 @@ export default defineComponent({ status.value = val; if (val !== undefined) { - // 调整值类型 if (isBoolean(val)) { activeValue.value = true; inactiveValue.value = false; - } else { - activeValue.value = props.activeValue; - inactiveValue.value = props.inactiveValue; + + return true; } } + + activeValue.value = props.activeValue; + inactiveValue.value = props.inactiveValue; }, { immediate: true