研发图纸文件管理系统-前端项目
iczer
2020-07-02 c6ba8815fbaf91c6764ebd842eaf108b04aa6938
fix: selection problem in ColorCheckBox radio mode; :bug:
修复:ColorCheckBox 单选模式下的选择问题;
1个文件已修改
13 ■■■■■ 已修改文件
src/components/checkbox/ColorCheckbox.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/checkbox/ColorCheckbox.vue
@@ -42,8 +42,8 @@
    }
  },
  watch: {
    values() {
      this.$emit('change', this.values, this.colors)
    values(value) {
      this.$emit('change', value, this.colors)
    },
    defaultValues(value) {
      if (this.multiple) {
@@ -61,9 +61,12 @@
  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
@@ -133,7 +136,9 @@
  },
  methods: {
    toggle () {
      this.sChecked = !this.sChecked
      if (this.groupContext.multiple || !this.sChecked) {
        this.sChecked = !this.sChecked
      }
    },
    initChecked() {
      let groupContext = this.groupContext