| | |
| | | /** |
| | | * CCheckBox |
| | | * 复选框组件,用于在表单中提供多选或单选功能 |
| | | * 支持两种显示模式:直接显示模式和弹窗选择模式 |
| | | * 支持两种选择类型:多选和单选 |
| | | * @author Tevin |
| | | */ |
| | | |
| | |
| | | return; |
| | | } |
| | | const selectedIndex = this.options.findIndex( |
| | | opt => opt.value === item |
| | | opt => opt.value === item, |
| | | ); |
| | | console.log(item, selectedIndex); |
| | | if (selectedIndex < 0) { |
| | | return; |
| | | } |
| | |
| | | // 单选 |
| | | else if (this.boxType === 'radio') { |
| | | const next = evt[evt.length - 1]; |
| | | const selectedIndex = this.options.find(opt => opt.value === item); |
| | | const selectedIndex = this.options.findIndex(opt => opt.value === next); |
| | | if (selectedIndex < 0) { |
| | | this.itemRes.onChange(''); |
| | | } else { |