From a250b6216753cfd0c0622a1fbc0f3254fc8e0a4f Mon Sep 17 00:00:00 2001 From: Tevin <tingquanren@163.com> Date: Tue, 19 Mar 2024 18:39:44 +0800 Subject: [PATCH] 图片预览组件,支持图片显示 --- forms/switch/CSwitch.vue | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/forms/switch/CSwitch.vue b/forms/switch/CSwitch.vue index a5620c1..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> @@ -21,7 +22,13 @@ name: 'CSwitch', components: { AtSwitch }, props: { + // 表单数据资源(表单组件内部机制专用) itemRes: Object, + // 只读模式 + readOnly: { + type: Boolean, + default: false, + }, }, data() { return {}; -- Gitblit v1.9.1