slider-100.uvue 1.6 KB
Newer Older
H
hdx 已提交
1
<template>
DCloud-WZF's avatar
DCloud-WZF 已提交
2
  <!-- #ifdef APP -->
H
hdx 已提交
3
  <scroll-view class="page">
DCloud-WZF's avatar
DCloud-WZF 已提交
4
    <!-- #endif -->
H
hdx 已提交
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
    <page-head :title="title"></page-head>
    <view class="flex-row">
      <view class="flex-fill">
        <slider v-for="(_, index1) in 25" :key="index1" class="slider" @changing="sliderChanging" :value="sliderValue"
          :block-size="sliderBlockSize" :show-value="true" />
      </view>
      <view class="flex-fill">
        <slider v-for="(_, index2) in 25" :key="index2" class="slider" @changing="sliderChanging" :value="sliderValue"
          :block-size="sliderBlockSize" :show-value="true" />
      </view>
      <view class="flex-fill">
        <slider v-for="(_, index3) in 25" :key="index3" class="slider" @changing="sliderChanging" :value="sliderValue"
          :block-size="sliderBlockSize" :show-value="true" />
      </view>
      <view class="flex-fill">
        <slider v-for="(_, index4) in 25" :key="index4" class="slider" @changing="sliderChanging" :value="sliderValue"
          :block-size="sliderBlockSize" :show-value="true" />
H
hdx 已提交
22 23
      </view>
    </view>
DCloud-WZF's avatar
DCloud-WZF 已提交
24 25 26
    <!-- #ifdef APP -->
  </scroll-view>
  <!-- #endif -->
H
hdx 已提交
27 28
</template>

H
hdx 已提交
29 30 31 32 33 34 35 36
<script>
  export default {
    data() {
      return {
        title: 'slider 滑块 x 100',
        sliderValue: 50,
        sliderBlockSize: 20
      }
DCloud-WZF's avatar
DCloud-WZF 已提交
37
    },
H
hdx 已提交
38 39 40 41 42 43
    methods: {
      sliderChanging(e: SliderChangeEvent) {
        this.sliderValue = e.detail.value
      },
    },
  }
H
hdx 已提交
44 45 46
</script>

<style>
H
hdx 已提交
47 48 49 50 51 52 53
  .page {
    flex: 1;
  }

  .flex-row {
    flex-direction: row;
  }
H
hdx 已提交
54

H
hdx 已提交
55 56 57
  .flex-fill {
    flex: 1;
  }
H
hdx 已提交
58

H
hdx 已提交
59 60 61 62
  .first-slider {
    margin: 12px 0;
    background-color: rgba(0, 0, 0, 0.1);
  }
H
hdx 已提交
63

H
hdx 已提交
64 65 66 67
  .slider {
    margin: 2px 0.5px;
  }
</style>