当前位置:   article > 正文

微信小程序-双滑块组件_微信小程序实现拖动价格slider功能

微信小程序实现拖动价格slider功能

先看效果:

组件 range-slider.wxml

  1. <view class='range-slider' style='width:{{width}}rpx;height:{{height}}rpx'>
  2. <view class='range-bar' style='width:100%;height:{{barHeight}}rpx'>
  3. <view class='range-bar-bg' style='background-color:{{backgroundColor}}'></view>
  4. <view class='range-bar-progress' style='margin-left:{{progressBarLeft}}rpx;width:{{progressBarWidth}}rpx;background-color:{{activeColor}}'></view>
  5. </view>
  6. <view class='block' style='width:{{blockSize}}rpx;height:{{blockSize}}rpx;margin-left:{{minBlockLeft}}rpx;' catch:touchstart='_onBlockTouchStart' catch:touchmove='_onBlockTouchMove' catch:touchend='_onBlockTouchEnd' data-left='{{minBlockLeft}}' data-tag='minBlock'>
  7. <slot name='minBlock'></slot>
  8. </view>
  9. <view class='block' style='width:{{blockSize}}rpx;height:{{blockSize}}rpx;margin-left:{{maxBlockLeft}}rpx;' catch:touchstart='_onBlockTouchStart' catch:touchmove='_onBlockTouchMove' catch:touchend='_onBlockTouchEnd' data-left='{{maxBlockLeft}}'
  10. data-tag='maxBlock'>
  11. <slot name='maxBlock'></slot>
  12. </view>
  13. </view>

 组件range-slider.js

代码地址:https://gitee.com/yin_dong/weixinshuanghuakuai/tree/master/wechat-rangeslider-master

乐于分享,有需要的随便用,不像是某些***,不让看

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/159443
推荐阅读
  

闽ICP备14008679号