slider-100.uvue 1.2 KB
Newer Older
H
hdx 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
<template>
  <view class="uni-padding-wrap">
    <page-head :title="title"></page-head>
    <view class="flex-row">
      <view class="flex-fill">
        <view v-for="(_, index1) in 33" :key="index1">
          <slider @changing="sliderChanging" :value="sliderValue" :block-size="15" :show-value="true" />
        </view>
      </view>
      <view class="flex-fill">
        <view v-for="(_, index2) in 33" :key="index2">
          <slider @changing="sliderChanging" :value="sliderValue" :block-size="15" :show-value="true" />
        </view>
      </view>
      <view class="flex-fill">
        <view v-for="(_, index3) in 33" :key="index3">
          <slider @changing="sliderChanging" :value="sliderValue" :block-size="15" :show-value="true" />
        </view>
      </view>
    </view>
  </view>
</template>

<script lang="ts">
  export default {
    data() {
      return {
        title: 'slider 滑块 x 100',
        sliderValue: 0
      }
    },
    methods: {
      sliderChanging(e : SliderChangeEvent) {
        this.sliderValue = e.detail.value
        console.log('value 发生变化:' + e.detail.value)
      }
    }
  }
</script>

<style>
  .flex-row {
    flex-direction: row;
  }
  .flex-fill {
    flex: 1;
  }
</style>