Add feature: allow spinner to have steps

This ads the possibility to choose `steps` in the formatting of the
lists. So we can have ”5 in five minutes” or ”every 15 minutes” instead
of having always lists of 60 items/minutes.
This commit is contained in:
Sergio Crisostomo 2017-08-13 09:12:53 +02:00
parent f3c6cd68d1
commit 9b37683241
5 changed files with 54 additions and 38 deletions

View file

@ -6,6 +6,7 @@
<time-spinner
ref="timeSpinner"
:show-seconds="showSeconds"
:steps="steps"
:hours="hours"
:minutes="minutes"
:seconds="seconds"
@ -39,6 +40,12 @@
name: 'TimePicker',
mixins: [ Mixin, Locale ],
components: { TimeSpinner, Confirm },
props: {
steps: {
type: Array,
default: () => []
}
},
data () {
return {
prefixCls: prefixCls,
@ -113,4 +120,4 @@
if (this.$parent && this.$parent.$options.name === 'DatePicker') this.showDate = true;
}
};
</script>
</script>