-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathExampleReactiveStyle.vue
44 lines (41 loc) · 1 KB
/
ExampleReactiveStyle.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
<script setup lang="ts">
import { ref } from 'vue'
import {
VueScrollPicker,
VueScrollPickerOption,
VueScrollPickerValue,
} from 'vue-scroll-picker'
import CurrentValue from './CurrentValue.vue'
import DefaultController from './DefaultController.vue'
defineProps<{
options: VueScrollPickerOption[]
}>()
const currentValue = ref<VueScrollPickerValue>(null)
const fontSize = ref(16)
</script>
<template>
<div>
<div class="controller">
<CurrentValue :value="currentValue" />
<DefaultController v-model="currentValue" :options="options" />
<div>
<span>Font Size: {{ fontSize }}px</span>
<input
v-model="fontSize"
type="range"
:min="4"
:max="128"
:step="1"
@input="($refs.picker as any).resize()"
/>
</div>
</div>
<div
:style="{
'font-size': `${fontSize}px`,
}"
>
<VueScrollPicker ref="picker" v-model="currentValue" :options="options" />
</div>
</div>
</template>