chore: improve Collapse、ContactCard jsx segment

This commit is contained in:
陈嘉涵
2019-12-16 12:01:57 +08:00
parent 9c6ae2c28b
commit 1dd0d42b5f
4 changed files with 71 additions and 51 deletions

View File

@@ -152,6 +152,7 @@ export default createComponent({
const now = Date.now();
const progress = Math.min((now - this.startTime) / this.duration, 1);
const rate = progress * (this.endRate - this.startRate) + this.startRate;
this.$emit('input', format(parseFloat(rate.toFixed(1))));
if (this.increase ? rate < this.endRate : rate > this.endRate) {