airyland / airyland/vux

range组件回滚

Aperta
#3,586 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Vue
Stelle
17.5k
Fork
3.6k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### VUX version
2.9.4

### OS/Browsers version
iPhone 7P/Chrome 76

### Vue version
2.6.10

### Code

```html



import { Range } from 'vux'
// import { setInterval } from 'timers'
export default {
name: 'Percent',
components: {
Range
},
data() {
return {
percent: 0
}
},
mounted: function() {
let i = 115
setInterval(() => {
this.percent = Math.floor(i)
i = 0.32
}, 330)
}
}

.audio-percent {
width: 4.5rem
}

.audio-percent .range-bar {
background-color: hsla(0,0%,100%,.6);
height: .05rem!important
}

.audio-percent .range-bar .range-handle {
height: .3rem!important;
width: .3rem!important;
top: -.12rem!important;
-webkit-box-shadow: 0 0 0 .066667rem hsla(0,0%,100%,.6);
box-shadow: 0 0 0 .066667rem hsla(0,0%,100%,.6)
}

.audio-percent .range-bar .range-max,.audio-percent .range-bar .range-min {
display: none
}

.audio-percent .range-bar .range-quantity {
background-color: #fff
}
html {
font-size: 55.2px;
}

```

### Steps to reproduce
在i=200左右的时候,按钮会回滚。
可以打印源码中的components-range -utils.js的findClosest函数:
console.log(closest);
return closest;
可以看到。

### What is Expected?
返回的 closest 应该是递增的,不应该减小(除非拖动或重置)

### What is actually happening?
实际会出现 198 => 200 => 198,这样的行为

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.