保誠-保戶業務員媒合平台
HelenHuang
2022-06-09 9bdb95c9e34cef640534e5e5a1e2225a80442000
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<style lang="scss" scoped>
.example1 {
  .vue-scroll-picker {
    height: 6em;
  }
}
</style>
<template>
  <div>
    <h3>Styling</h3>
    <h4>Height</h4>
    <p>You can adjust the height of the vue-scroll-picker through CSS.</p>
    <pre v-highlightjs><code class="html">{{ exampleHeight }}</code></pre>
    <div class="example1">
      <input type="range" :min="4" :max="64" :step="1" v-model="fontSize" @input="onChangeFontSize" />
      <div :style="{
        'font-size': `${fontSize}px`,
      }">
        <scroll-picker :options="options" ref="scroll" />
      </div>
    </div>
 
    <h4>Inherit font-size</h4>
    <p>The size of the vue-scroll-picker inherits the font-size of the parent node.</p>
    <h5>Size 24px + Group with Flex</h5>
    <pre v-highlightjs><code class="html">{{ example1 }}</code></pre>
    <div style="font-size: 24px;">
      <scroll-picker-group class="flex">
        <scroll-picker :options="options" />
        <scroll-picker :options="options" />
        <scroll-picker :options="options" />
      </scroll-picker-group>
    </div>
 
    <h5>Font Size 12px + Group with Grid</h5>
    <pre v-highlightjs><code class="html">{{ example2 }}</code></pre>
    <div style="font-size: 12px;">
      <scroll-picker-group>
        <scroll-picker class="vue-scroll-picker-8" :options="options"></scroll-picker>
        <scroll-picker class="vue-scroll-picker-4" :options="options"></scroll-picker>
      </scroll-picker-group>
    </div>
  </div>
</template>
<script>
function unique(items) {
  return [...new Set(items)]
}
export default {
  data() {
    return {
      fontSize: 24,
      exampleHeight: `<style>
.example .vue-scroll-picker {
  height: 6em; /* default 10em */
}
</style>
<div class="example">
  <scroll-picker :options="options" />
</div>`,
      example1: `<div style="font-size: 24px;">
  <scroll-picker-group class="flex">
    <scroll-picker :options="options"></scroll-picker>
    <scroll-picker :options="options"></scroll-picker>
    <scroll-picker :options="options"></scroll-picker>
  </scroll-picker-group>
</div>`,
      example2: `<div style="font-size: 12px;">
  <scroll-picker-group>
    <scroll-picker class="vue-scroll-picker-8" :options="options"></scroll-picker>
    <scroll-picker class="vue-scroll-picker-4" :options="options"></scroll-picker>
  </scroll-picker-group>
</div>`,
      options: [
        {value: 0, name: "0KG"},
        {value: 10, name: "10KG"},
        {value: 20, name: "20KG"},
        {value: 30, name: "30KG"},
        {value: 40, name: "40KG"},
        {value: 50, name: "50KG"},
        {value: 60, name: "60KG"},
        {value: 70, name: "70KG"},
        {value: 80, name: "80KG"},
        {value: 90, name: "90KG"},
        {value: 100, name: "100KG"},
      ],
    }
  },
  methods: {
    onChangeFontSize() {
      this.$refs.scroll.resize()
    },
  },
}
</script>