feat(date-picker): clear on non-range panel

This commit is contained in:
07akioni 2020-01-09 17:38:25 +08:00
parent a2bc7df45f
commit d08d6a1f8f
3 changed files with 17 additions and 1 deletions

View File

@ -75,6 +75,14 @@
v-if="actions && actions.length"
class="n-date-panel-actions"
>
<n-button
v-if="actions.includes('clear')"
size="tiny"
round
@click="clearValue"
>
Clear
</n-button>
<n-button
v-if="actions.includes('now')"
size="tiny"

View File

@ -97,6 +97,14 @@
v-if="actions && actions.length"
class="n-date-panel-actions"
>
<n-button
v-if="actions.includes('clear')"
size="tiny"
round
@click="clearValue"
>
Clear
</n-button>
<n-button
v-if="actions.includes('now')"
size="tiny"

View File

@ -35,7 +35,7 @@ export default {
},
actions: {
type: Array,
default: () => ['now', 'confirm']
default: () => ['now', 'clear', 'confirm']
},
isDateDisabled: {
type: Function,