forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventColor.vue
More file actions
40 lines (37 loc) · 867 Bytes
/
EventColor.vue
File metadata and controls
40 lines (37 loc) · 867 Bytes
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
<template>
<div class="q-pa-md">
<div class="q-gutter-md">
<q-date
v-model="date"
:events="events"
:event-color="(date) => date[9] % 2 === 0 ? 'teal' : 'orange'"
/>
<q-date
v-model="date"
:events="eventsFn"
:event-color="(date) => date[9] % 2 === 0 ? 'teal' : 'orange'"
/>
</div>
</div>
</template>
<script>
import { ref } from 'vue'
export default {
setup () {
return {
date: ref('2019/02/01'),
events: [ '2019/02/01', '2019/02/05', '2019/02/06', '2019/02/09', '2019/02/23' ],
eventsFn (date) {
if (date === '2019/02/01' ||
date === '2019/02/05' ||
date === '2019/02/06' ||
date === '2019/02/09' ||
date === '2019/02/23') {
return true
}
return false
}
}
}
}
</script>