<template>
<view>
<view>
<view class="progress-bar" @click="slideClick" :style="{'background':'url('+bg1+')','background-size':'100% 1rem'}">
<view class="pro-bar" :style="{'width':sliderNum+'%','background':'url('+bg2+')','background-size':NewWidth+'px 1rem'}"></view>
<view class="block" @touchmove="slideTouchmove" :style="{'left':blockLeft+'px'}"></view>
</view>
<view>{
{sliderNum}}%</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
sliderNum:0,
/* 滑动条宽度 */
NewWidth:0,
/* 滑动条按钮宽度 */
blockWidth:0,
startX:0,
mousedownLeft:0,
blockLeft:0,
nui-app 滑动条 可修改背景图片跟滑动按钮图片
最新推荐文章于 2024-06-21 11:18:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)