WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2022-03-23 7e7f06ed96d49c59a944720c2781e95ec00a7a76
CSwitchRadio增加左对齐模式
2 files modified
20 ■■■■■ changed files
forms/switch/CSwitchRadio.vue 10 ●●●●● patch | view | raw | blame | history
forms/switch/cSwitch.scss 10 ●●●●● patch | view | raw | blame | history
forms/switch/CSwitchRadio.vue
@@ -51,10 +51,17 @@
    props: {
        // 表单数据资源(表单组件内部机制专用)
        itemRes: Object,
        // 选项对齐方式,left / right(默认)
        checkAlign: {
            type: String,
            default: 'right',
        },
        // 选中文字
        checkedLabel: {
            type: String,
            default: '是',
        },
        // 不选中文字
        uncheckedLabel: {
            type: String,
            default: '否',
@@ -66,6 +73,9 @@
    computed: {
        className() {
            let className = '';
            if (this.checkAlign === 'left') {
                className += 'c-switch-radio-left ';
            }
            if (this.itemRes.required) {
                className += 'c-switch-required ';
            }
forms/switch/cSwitch.scss
@@ -74,4 +74,14 @@
            padding-left: 6px;
        }
    }
    &.c-switch-radio-left {
        .c-switch-radio-group {
            width: 538px;
            padding-right: 0;
            .c-switch-radio-item {
                padding-left: 0;
                padding-right: 22px;
            }
        }
    }
}