| | |
| | | data() { |
| | | return { |
| | | tagType: 'primary', |
| | | tagColor: '' |
| | | tagColor: '', |
| | | colorArr:['primary','success','info','warning','danger'] |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | methods: { |
| | | async init() { |
| | | let value = this.value + '' |
| | | |
| | | if (this.typeS && this.typeS.split(',').indexOf(value) >= 0) { |
| | | this.tagType = 'success' |
| | | } |
| | |
| | | } |
| | | 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] |
| | | } |
| | | } |
| | | } |