fix: selection problem in ColorCheckBox radio mode; :bug:
修复:ColorCheckBox 单选模式下的选择问题;
| | |
| | | } |
| | | }, |
| | | watch: { |
| | | values() { |
| | | this.$emit('change', this.values, this.colors) |
| | | values(value) { |
| | | this.$emit('change', value, this.colors) |
| | | }, |
| | | defaultValues(value) { |
| | | if (this.multiple) { |
| | |
| | | methods: { |
| | | handleChange (option) { |
| | | if (!option.checked) { |
| | | this.values = this.values.filter(item => item !== option.value) |
| | | if (this.values.indexOf(option.value) > -1) { |
| | | this.values = this.values.filter(item => item != option.value) |
| | | } |
| | | } else { |
| | | if (!this.multiple) { |
| | | this.values = [option.value] |
| | | this.options.forEach(item => { |
| | | if (item.value != option.value) { |
| | | item.sChecked = false |
| | |
| | | }, |
| | | methods: { |
| | | toggle () { |
| | | this.sChecked = !this.sChecked |
| | | if (this.groupContext.multiple || !this.sChecked) { |
| | | this.sChecked = !this.sChecked |
| | | } |
| | | }, |
| | | initChecked() { |
| | | let groupContext = this.groupContext |