v3.0.6
This commit is contained in:
29
source/wx/xzs-student/component/iView/badge/index.js
Normal file
29
source/wx/xzs-student/component/iView/badge/index.js
Normal file
@@ -0,0 +1,29 @@
|
||||
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
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user