Make label to show if selected date is null configurable
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
kolaente 2020-11-25 18:00:56 +01:00
parent 96d27c6bb9
commit 943098f7d1
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 11 additions and 3 deletions

View File

@ -1,8 +1,12 @@
<template>
<div class="datepicker">
<a @click.stop="show = !show">
show
{{ formatDate(date) }}
<template v-if="date === null">
{{ chooseDateLabel }}
</template>
<template v-else>
{{ formatDate(date) }}
</template>
</a>
<transition name="fade">
@ -127,7 +131,11 @@ export default {
props: {
value: {
validator: prop => prop instanceof Date || prop === null
}
},
chooseDateLabel: {
type: String,
default: 'Choose a date'
},
},
mounted() {
this.date = this.value