From 7e7f06ed96d49c59a944720c2781e95ec00a7a76 Mon Sep 17 00:00:00 2001 From: Tevin <tingquanren@163.com> Date: Wed, 23 Mar 2022 18:31:54 +0800 Subject: [PATCH] CSwitchRadio增加左对齐模式 --- forms/switch/CSwitchRadio.vue | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/forms/switch/CSwitchRadio.vue b/forms/switch/CSwitchRadio.vue index 93feb20..b82eb85 100644 --- a/forms/switch/CSwitchRadio.vue +++ b/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 '; } -- Gitblit v1.9.1