| | |
| | | */ |
| | | |
| | | <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> |
| | |
| | | props: { |
| | | // 表单数据资源(表单组件内部机制专用) |
| | | itemRes: Object, |
| | | // 只读模式 |
| | | readOnly: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | }, |
| | | data() { |
| | | return {}; |
| | |
| | | @import "../../common/sassMixin"; |
| | | |
| | | .c-switch { |
| | | &.read-only { |
| | | pointer-events: none; |
| | | background-color: #fafafa; |
| | | .at-switch { |
| | | background-color: transparent; |
| | | } |
| | | .at-switch__container { |
| | | background-color: transparent; |
| | | } |
| | | } |
| | | .at-switch__title { |
| | | font-size: 36px; |
| | | } |