Blame view

examples/routers/slider.vue 1.34 KB
4ec205b6   梁灏   add Tag UI
1
  <template>
a6fc9438   梁灏   fixed #461
2
      <div style="margin: 0 400px;">
11036a47   Sergio Crisostomo   extend slider dev...
3
4
5
6
7
          <Slider v-model="valueSingle" @on-change="updateSingleDisplayValue"></Slider>
          <Button @click="randomSingle">change</Button> {{singleDisplayValue}}
  
          <Slider v-model="valueRange" range @on-change="updateRangeDisplayValue"></Slider>
          <Button @click="randomRange">change</Button> {{rangeDisplayValue}}
69576f47   梁灏   add Slider component
8
      </div>
4ec205b6   梁灏   add Tag UI
9
10
  </template>
  <script>
4ec205b6   梁灏   add Tag UI
11
      export default {
36febc3c   梁灏   add Slider
12
13
          data () {
              return {
11036a47   Sergio Crisostomo   extend slider dev...
14
15
16
17
18
                  valueSingle: 10,
                  valueRange: [20, 50],
                  singleDisplayValue: 10,
                  rangeDisplayValue: [20, 50]
              };
36febc3c   梁灏   add Slider
19
          },
4ec205b6   梁灏   add Tag UI
20
          methods: {
11036a47   Sergio Crisostomo   extend slider dev...
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
              updateSingleDisplayValue (val){
                  console.log('updateSingleDisplayValue', val);
                  this.singleDisplayValue = val;
              },
              updateRangeDisplayValue (val){
                  console.log('updateRangeDisplayValue', val);
                  this.rangeDisplayValue = val.join(' - ');
              },
              randomSingle () {
                  this.valueSingle = this.random(0, 100);
              },
              randomRange () {
                  this.valueRange = [this.random(0, 50), this.random(50, 100)];
              },
              random (min, max){
                  return Math.round(Math.random() * (max - min)) + min;
9dde24b6   梁灏   add LoadingBar co...
37
              }
4ec205b6   梁灏   add Tag UI
38
          }
11036a47   Sergio Crisostomo   extend slider dev...
39
      };
e355dd49   梁灏   add Select Component
40
  </script>