wente
2023-11-16 b341867731286e7ebfa1bc5fd8f699c780d232a4
web/packages/components/zt-dict-tag/src/zt-dict-tag.vue
@@ -32,7 +32,8 @@
    data() {
      return {
        tagType: 'primary',
        tagColor: ''
        tagColor: '',
        colorArr:['primary','success','info','warning','danger']
      }
    },
    mounted() {
@@ -41,6 +42,7 @@
    methods: {
      async init() {
        let value = this.value + ''
        if (this.typeS && this.typeS.split(',').indexOf(value) >= 0) {
          this.tagType = 'success'
        }
@@ -58,7 +60,9 @@
        }
        if (!this.typeS && !this.typeI && !this.typeW && !this.typeD && !this.typeColor) { // 没有指定颜色
          if (this.value === false || this.value === 0 || this.value === '0' || this.value === 'false') {
            this.tagType = 'info'
            this.tagType = 'primary'
          }else{
            this.tagType = this.colorArr[this.value%5]
          }
        }
      }