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 {};