miniprogram/miniprogram_npm/@vant/weapp/slider/index.wxml

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<wxs src="../wxs/utils.wxs" module="utils" />
<wxs src="../wxs/style.wxs" module="style" />

<view
  class="custom-class {{ utils.bem('slider', { disabled, vertical }) }}"
  style="{{ wrapperStyle }}"
  bind:tap="onClick"
>
  <view
    class="{{ utils.bem('slider__bar') }}"
    style="{{ barStyle }}; {{ style({ backgroundColor: activeColor }) }}"
  >
    <view
      wx:if="{{ range }}"
      class="{{ utils.bem('slider__button-wrapper-left') }}"
      data-index="{{ 0 }}"
      bind:touchstart="onTouchStart"
      catch:touchmove="onTouchMove"
      bind:touchend="onTouchEnd"
      bind:touchcancel="onTouchEnd"
    >
      <slot
        wx:if="{{ useButtonSlot }}"
        name="left-button"
      />
      <view
        wx:else
        class="{{ utils.bem('slider__button') }}"
      />
    </view>
    <view
      wx:if="{{ range }}"
      class="{{ utils.bem('slider__button-wrapper-right') }}"
      data-index="{{ 1 }}"
      bind:touchstart="onTouchStart"
      catch:touchmove="onTouchMove"
      bind:touchend="onTouchEnd"
      bind:touchcancel="onTouchEnd"
    >
      <slot
        wx:if="{{ useButtonSlot }}"
        name="right-button"
      />
      <view
        wx:else
        class="{{ utils.bem('slider__button') }}"
      />
    </view>

    <view
      wx:if="{{ !range }}"
      class="{{ utils.bem('slider__button-wrapper') }}"
      bind:touchstart="onTouchStart"
      catch:touchmove="onTouchMove"
      bind:touchend="onTouchEnd"
      bind:touchcancel="onTouchEnd"
    >
      <slot
        wx:if="{{ useButtonSlot }}"
        name="button"
后面还有 8 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。