forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarkerLabels.vue
More file actions
80 lines (73 loc) · 1.54 KB
/
MarkerLabels.vue
File metadata and controls
80 lines (73 loc) · 1.54 KB
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
<template>
<div class="q-px-lg q-pt-md q-pb-xl">
<q-range
v-model="model"
marker-labels
:min="0"
:max="6"
/>
<q-range
class="q-mt-xl"
v-model="model"
color="deep-orange"
markers
:marker-labels="fnMarkerLabel"
:min="0"
:max="6"
/>
<q-range
class="q-mt-xl"
v-model="model"
color="purple"
markers
:marker-labels="objMarkerLabel"
:min="0"
:max="6"
/>
<q-range
class="q-mt-xl"
v-model="priceModel"
color="green"
:inner-min="3"
:inner-max="6"
markers
:marker-labels="arrayMarkerLabel"
label-always
:left-label-value="minPriceLabel"
:right-label-value="maxPriceLabel"
switch-label-side
switch-marker-labels-side
:min="2"
:max="7"
/>
</div>
</template>
<script>
import { ref, computed } from 'vue'
export default {
setup () {
const model = ref({
min: 2,
max: 4
})
const priceModel = ref({
min: 4,
max: 6
})
return {
model,
fnMarkerLabel: val => `${10 * val}%`,
objMarkerLabel: { 0: '0°C', 3: { label: '3°C' }, 5: '5°C', 6: '6°C' },
priceModel,
minPriceLabel: computed(() => `$ ${priceModel.value.min}`),
maxPriceLabel: computed(() => `$ ${priceModel.value.max}`),
arrayMarkerLabel: [
{ value: 3, label: '$3' },
{ value: 4, label: '$4' },
{ value: 5, label: '$5' },
{ value: 6, label: '$6' }
]
}
}
}
</script>