ASR/miniprogram/dist/badge/index.js
Saturneric 73fc37e472 Add.
2020-09-01 00:55:41 +08:00

30 lines
646 B
JavaScript

Component({
externalClasses: ['i-class', 'i-class-alone'],
properties: {
count: {
type: Number,
value: 0,
observer: 'finalCount'
},
overflowCount: {
type: Number,
value: 99
},
dot: {
type: Boolean,
value: false
},
},
data: {
finalCount: 0
},
methods: {
finalCount() {
this.setData({
finalCount: parseInt(this.data.count) >= parseInt(this.data.overflowCount) ? `${this.data.overflowCount}+` : this.data.count
});
},
}
});