研发图纸文件管理系统-前端项目
iczer
2020-07-02 5c0ccf9df9bbff455e2ca60547f8544fa3cba03e
fix: selection problem in ColorCheckBox radio mode; :bug:
修复:ColorCheckBox 单选模式下的选择问题;
1个文件已修改
14 ■■■■■ 已修改文件
src/components/checkbox/ColorCheckbox.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/checkbox/ColorCheckbox.vue
@@ -44,18 +44,6 @@
  watch: {
    values(value) {
      this.$emit('change', value, this.colors)
    },
    defaultValues(value) {
      if (this.multiple) {
        this.options.forEach(item => {
          item.sChecked = value.indexOf(item.value) > -1
        })
      } else {
        this.options.forEach(item => {
          let first = value[0]
          item.sChecked = first && first == item.value
        })
      }
    }
  },
  methods: {
@@ -143,7 +131,7 @@
    initChecked() {
      let groupContext = this.groupContext
      if (!groupContext) {
        return this.check
        return this.checked
      }else if (groupContext.multiple) {
        return groupContext.defaultValues.indexOf(this.value) > -1
      } else {