From 3b03f87a02458f719e2eb4bf112a13441b427d14 Mon Sep 17 00:00:00 2001 From: ‘chensiAb’ <‘chenchenco03@163.com’> Date: Tue, 25 Mar 2025 13:54:34 +0800 Subject: [PATCH] Merge branch 'master' of ssh://dev.zhiheiot.com:29418/mob-components --- forms/switch/CSwitch.vue | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/forms/switch/CSwitch.vue b/forms/switch/CSwitch.vue index c8662f5..6917985 100644 --- a/forms/switch/CSwitch.vue +++ b/forms/switch/CSwitch.vue @@ -1,13 +1,17 @@ /** * CSwitch + * 开关组件,用于在表单中提供开关选择功能 + * 基于 AtSwitch 封装,支持只读模式 + * 能够显示必填和错误状态 * @author Tevin */ <template> - <view :class="['c-switch', className]"> + <view :class="['c-switch', className, readOnly?'read-only':'']"> <AtSwitch :title="itemRes.label" :checked="itemRes.formData[itemRes.name]" + :disabled="readOnly" :onChange="evt=>itemRes.onChange(evt)" /> </view> @@ -23,6 +27,11 @@ props: { // 表单数据资源(表单组件内部机制专用) itemRes: Object, + // 只读模式 + readOnly: { + type: Boolean, + default: false, + }, }, data() { return {}; -- Gitblit v1.9.1