Make label to show if selected date is null configurable
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
96d27c6bb9
commit
943098f7d1
|
@ -1,8 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="datepicker">
|
<div class="datepicker">
|
||||||
<a @click.stop="show = !show">
|
<a @click.stop="show = !show">
|
||||||
show
|
<template v-if="date === null">
|
||||||
|
{{ chooseDateLabel }}
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
{{ formatDate(date) }}
|
{{ formatDate(date) }}
|
||||||
|
</template>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<transition name="fade">
|
<transition name="fade">
|
||||||
|
@ -127,7 +131,11 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
validator: prop => prop instanceof Date || prop === null
|
validator: prop => prop instanceof Date || prop === null
|
||||||
}
|
},
|
||||||
|
chooseDateLabel: {
|
||||||
|
type: String,
|
||||||
|
default: 'Choose a date'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.date = this.value
|
this.date = this.value
|
||||||
|
|
Reference in New Issue
Block a user