进度条颜色
This commit is contained in:
@ -71,7 +71,7 @@
|
||||
<view @touchmove.prevent>
|
||||
<slider :value="sliderValue" min="10" max="100" activeColor="rgb(187, 230, 0)"
|
||||
backgroundColor="rgb(26, 26, 26)" :show-value="false" @changing="onSliderChanging"
|
||||
@change="onSliderChangeEnd" block-color="#BBE600" block-size="20" />
|
||||
@change="onSliderChangeEnd" block-color="#fff" block-size="20" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -372,15 +372,11 @@
|
||||
const touchX = e.touches[0].clientX;
|
||||
const cardLeft = this.cardRect.left;
|
||||
const cardWidth = this.cardRect.width;
|
||||
|
||||
let relativeX = touchX - cardLeft;
|
||||
|
||||
// 边界处理
|
||||
if (relativeX < 0) relativeX = 0;
|
||||
if (relativeX > cardWidth) relativeX = cardWidth;
|
||||
|
||||
const newValue = Math.round((relativeX / cardWidth) * 100);
|
||||
|
||||
// 调用已有的节流函数来更新值和发送命令
|
||||
this.onSliderChanging({
|
||||
detail: {
|
||||
|
Reference in New Issue
Block a user