mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-06 04:00:06 +08:00
fix: selection problem in ColorCheckBox radio mode; 🐛
修复:ColorCheckBox 单选模式下的选择问题;
This commit is contained in:
parent
36e9e0a9f0
commit
c6ba8815fb
@ -42,8 +42,8 @@ const Group = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
values() {
|
values(value) {
|
||||||
this.$emit('change', this.values, this.colors)
|
this.$emit('change', value, this.colors)
|
||||||
},
|
},
|
||||||
defaultValues(value) {
|
defaultValues(value) {
|
||||||
if (this.multiple) {
|
if (this.multiple) {
|
||||||
@ -61,9 +61,12 @@ const Group = {
|
|||||||
methods: {
|
methods: {
|
||||||
handleChange (option) {
|
handleChange (option) {
|
||||||
if (!option.checked) {
|
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 {
|
} else {
|
||||||
if (!this.multiple) {
|
if (!this.multiple) {
|
||||||
|
this.values = [option.value]
|
||||||
this.options.forEach(item => {
|
this.options.forEach(item => {
|
||||||
if (item.value != option.value) {
|
if (item.value != option.value) {
|
||||||
item.sChecked = false
|
item.sChecked = false
|
||||||
@ -133,7 +136,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggle () {
|
toggle () {
|
||||||
this.sChecked = !this.sChecked
|
if (this.groupContext.multiple || !this.sChecked) {
|
||||||
|
this.sChecked = !this.sChecked
|
||||||
|
}
|
||||||
},
|
},
|
||||||
initChecked() {
|
initChecked() {
|
||||||
let groupContext = this.groupContext
|
let groupContext = this.groupContext
|
||||||
|
Loading…
x
Reference in New Issue
Block a user