make sure count compare as number

This commit is contained in:
afc163 2019-03-08 15:57:07 +08:00
parent da6662562b
commit bd0eb34487
No known key found for this signature in database
GPG Key ID: 738F973FCE5C6B48

View File

@ -64,7 +64,7 @@ class ScrollNumber extends Component<ScrollNumberProps, ScrollNumberState> {
const currentDigit = getNumberArray(this.state.count)[i];
const lastDigit = getNumberArray(this.lastCount)[i];
// 同方向则在同一侧切换数字
if (this.state.count! > this.lastCount!) {
if (Number(this.state.count) > Number(this.lastCount)) {
if (currentDigit >= lastDigit) {
return 10 + num;
}