Make label to show if selected date is null configurable
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
96d27c6bb9
commit
943098f7d1
|
@ -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
|
||||
|
|
Reference in New Issue