-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathExampleSensitivity.vue
85 lines (82 loc) · 1.94 KB
/
ExampleSensitivity.vue
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
<script setup lang="ts">
import { ref } from 'vue'
import {
VueScrollPicker,
VueScrollPickerOption,
VueScrollPickerValue,
} from 'vue-scroll-picker'
import CurrentValue from './CurrentValue.vue'
defineProps<{
options: VueScrollPickerOption[]
}>()
const currentValue = ref<VueScrollPickerValue>(null)
const dragSensitivity = ref(1.7)
const touchSensitivity = ref(1.7)
const scrollSensitivity = ref(1)
</script>
<template>
<div>
<div class="controller">
<CurrentValue :value="currentValue" />
<div class="nobs">
<div class="nob">
<label>Drag Sensitivity (default = 1.7)</label>
<div>
<input
v-model.number="dragSensitivity"
type="range"
min="0.5"
max="10"
step="0.1"
/>
{{ dragSensitivity }}
</div>
</div>
<div class="nob">
<label>Touch Sensitivity (default = 1.7)</label>
<div>
<input
v-model.number="touchSensitivity"
type="range"
min="0.5"
max="10"
step="0.1"
/>
{{ touchSensitivity }}
</div>
</div>
<div class="nob">
<label>Scroll Sensitivity (default = 1)</label>
<div>
<input
v-model.number="scrollSensitivity"
type="range"
min="0.5"
max="10"
step="0.1"
/>
{{ scrollSensitivity }}
</div>
</div>
</div>
</div>
<VueScrollPicker
v-model="currentValue"
:drag-sensitivity="dragSensitivity"
:touch-sensitivity="touchSensitivity"
:scroll-sensitivity="scrollSensitivity"
:options="options"
/>
</div>
</template>
<style scoped>
.nobs {
display: flex;
flex-wrap: wrap;
margin-left: -0.5rem;
margin-right: -0.5rem;
}
.nob {
margin: 0.5rem;
}
</style>