forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptions.vue
More file actions
59 lines (52 loc) · 1.19 KB
/
Copy pathOptions.vue
File metadata and controls
59 lines (52 loc) · 1.19 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
<template>
<div class="q-pa-md">
<div class="q-gutter-md">
<q-time
v-model="time1"
:hour-options="hourOptionsTime1"
:minute-options="minuteOptionsTime1"
:second-options="secondOptionsTime1"
with-seconds
/>
<q-time
v-model="time2"
:options="optionsFnTime2"
with-seconds
/>
<q-time
v-model="time3"
:options="optionsFnTime3"
/>
</div>
</div>
</template>
<script>
import { ref } from 'vue'
export default {
setup () {
return {
time1: ref('10:45:40'),
time2: ref('14:27:20'),
time3: ref('10:56'),
hourOptionsTime1: [ 9, 10, 11, 13, 15 ],
minuteOptionsTime1: [ 0, 15, 30, 45 ],
secondOptionsTime1: [ 0, 10, 20, 30, 40, 50 ],
optionsFnTime2 (hr, min, sec) {
if (hr < 6 || hr > 15 || hr % 2 !== 0) {
return false
}
if (min !== null && (min <= 25 || min >= 58)) {
return false
}
if (sec !== null && sec % 25 !== 0) {
return false
}
return true
},
optionsFnTime3 (hr) {
return hr % 2 === 0 || hr % 3 === 0
}
}
}
}
</script>