2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-25 13:20:35 +03:00

feat: add the prop scroll-duration (#475)

This commit is contained in:
mengxiong10
2020-05-31 11:23:31 +08:00
parent 1cdfe9d022
commit 051ad89c24
4 changed files with 54 additions and 43 deletions
+2 -1
View File
@@ -112,7 +112,7 @@ You can also override some of the default locale by `lang`.
### Props
| Prop | Description | Type | Default |
| ------------------- | ---------------------------------------------- | ------------------------------------------- | -------------- |
| ------------------- | ------------------------------------------------ | ------------------------------------------- | -------------- |
| type | select the type of picker | date \|datetime\|year\|month\|time\|week | 'date' |
| range | if true, pick the range date | `boolean` | false |
| format | to set the date format. similar to moment.js | [token](#token) | 'YYYY-MM-DD' |
@@ -153,6 +153,7 @@ You can also override some of the default locale by `lang`.
| time-title-format | format of the time header | [token](#token) | 'YYYY-MM-DD' |
| time-picker-options | set fixed time list to select | [time-picker-options](#time-picker-options) | null |
| prefix-class | set prefix class | `string` | 'mx' |
| scroll-duration | set the duration of scroll when hour is selected | `number` | 100 |
#### Token
+1
View File
@@ -151,6 +151,7 @@ import 'vue2-datepicker/locale/zh-cn';
| time-title-format | 时间面板头部的格式化 | [token](#token) | 'YYYY-MM-DD' |
| time-picker-options | 设置固定时间去选择 | [time-picker-options](#time-picker-options) | null |
| prefix-class | 设置 class 的前缀 | `string` | 'mx' |
| scroll-duration | 设置滚动时候当选中小时的时候 | `number` | 100 |
#### Token
+5 -1
View File
@@ -74,6 +74,10 @@ export default {
},
props: {
date: Date,
scrollDuration: {
type: Number,
default: 100,
},
getClasses: {
type: Function,
default: () => [],
@@ -125,7 +129,7 @@ export default {
date: {
handler() {
this.$nextTick(() => {
this.scrollToSelected(100);
this.scrollToSelected(this.scrollDuration);
});
},
},
+5
View File
@@ -28,6 +28,7 @@
:hour-step="hourStep"
:minute-step="minuteStep"
:second-step="secondStep"
:scroll-duration="scrollDuration"
v-bind="ShowHourMinuteSecondAMPM"
@select="handleSelect"
></list-columns>
@@ -114,6 +115,10 @@ export default {
type: Boolean,
default: undefined,
},
scrollDuration: {
type: Number,
default: 100,
},
},
computed: {
innerValue() {