From a5355c38114640c5e54863ba14a1de6485ed38c0 Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Mon, 05 Jun 2023 20:36:22 +0800
Subject: [PATCH] Merge branch 'master' of ssh://dev.zhiheiot.com:29418/mob-components

---
 forms/switch/CSwitch.vue |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/forms/switch/CSwitch.vue b/forms/switch/CSwitch.vue
index c8662f5..9d459d9 100644
--- a/forms/switch/CSwitch.vue
+++ b/forms/switch/CSwitch.vue
@@ -4,10 +4,11 @@
  */
 
 <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 +24,11 @@
     props: {
         // 表单数据资源(表单组件内部机制专用)
         itemRes: Object,
+        // 只读模式
+        readOnly: {
+            type: Boolean,
+            default: false,
+        },
     },
     data() {
         return {};

--
Gitblit v1.9.1