minor with calendar
This commit is contained in:
@@ -1,17 +1,18 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
#calendar
|
#calendar
|
||||||
vc-calendar(
|
vc-date-picker(
|
||||||
|
v-model='selectedDate'
|
||||||
title-position='left'
|
title-position='left'
|
||||||
:is-dark="settings['theme.is_dark']"
|
:is-dark="settings['theme.is_dark']"
|
||||||
:columns="$screens({ sm: 2 }, 1)"
|
:columns="$screens({ sm: 2 }, 1)"
|
||||||
|
@input='click'
|
||||||
@update:from-page='updatePage'
|
@update:from-page='updatePage'
|
||||||
:locale='$i18n.locale'
|
:locale='$i18n.locale'
|
||||||
:attributes='attributes'
|
:attributes='attributes'
|
||||||
transition='fade'
|
transition='fade'
|
||||||
aria-label='Calendar'
|
aria-label='Calendar'
|
||||||
is-expanded
|
is-expanded
|
||||||
is-inline
|
is-inline)
|
||||||
@dayclick='click')
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -28,6 +29,7 @@ export default {
|
|||||||
const month = dayjs().month() + 1
|
const month = dayjs().month() + 1
|
||||||
const year = dayjs().year()
|
const year = dayjs().year()
|
||||||
return {
|
return {
|
||||||
|
selectedDate: null,
|
||||||
page: { month, year }
|
page: { month, year }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
.col.pt-0.pt-md-2
|
.col.pt-0.pt-md-2
|
||||||
Search(:filters='filters' @update='updateFilters')
|
Search(:filters='filters' @update='updateFilters')
|
||||||
v-chip(v-show='selectedDay' close :close-icon='mdiCloseCircle' @click:close='dayChange({ date: selectedDay})') {{selectedDay}}
|
v-chip(v-if='selectedDay' close :close-icon='mdiCloseCircle' @click:close='dayChange({ date: selectedDay})') {{selectedDay}}
|
||||||
|
|
||||||
//- Events
|
//- Events
|
||||||
#events.mb-2.mt-1.pl-1.pl-sm-2
|
#events.mb-2.mt-1.pl-1.pl-sm-2
|
||||||
@@ -175,12 +175,7 @@ export default {
|
|||||||
this.setFilters(filters)
|
this.setFilters(filters)
|
||||||
},
|
},
|
||||||
dayChange (day) {
|
dayChange (day) {
|
||||||
const date = dayjs(day.date).format('YYYY-MM-DD')
|
this.selectedDay = day ? dayjs(day).format('YYYY-MM-DD') : null
|
||||||
if (this.selectedDay === date) {
|
|
||||||
this.selectedDay = null
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.selectedDay = date
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user