mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-25 07:10:35 +03:00
feat: add the prop scroll-duration (#475)
This commit is contained in:
@@ -112,7 +112,7 @@ You can also override some of the default locale by `lang`.
|
|||||||
### Props
|
### Props
|
||||||
|
|
||||||
| Prop | Description | Type | Default |
|
| Prop | Description | Type | Default |
|
||||||
| ------------------- | ---------------------------------------------- | ------------------------------------------- | -------------- |
|
| ------------------- | ------------------------------------------------ | ------------------------------------------- | -------------- |
|
||||||
| type | select the type of picker | date \|datetime\|year\|month\|time\|week | 'date' |
|
| type | select the type of picker | date \|datetime\|year\|month\|time\|week | 'date' |
|
||||||
| range | if true, pick the range date | `boolean` | false |
|
| range | if true, pick the range date | `boolean` | false |
|
||||||
| format | to set the date format. similar to moment.js | [token](#token) | 'YYYY-MM-DD' |
|
| 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-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 |
|
| time-picker-options | set fixed time list to select | [time-picker-options](#time-picker-options) | null |
|
||||||
| prefix-class | set prefix class | `string` | 'mx' |
|
| prefix-class | set prefix class | `string` | 'mx' |
|
||||||
|
| scroll-duration | set the duration of scroll when hour is selected | `number` | 100 |
|
||||||
|
|
||||||
#### Token
|
#### Token
|
||||||
|
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ import 'vue2-datepicker/locale/zh-cn';
|
|||||||
| time-title-format | 时间面板头部的格式化 | [token](#token) | 'YYYY-MM-DD' |
|
| time-title-format | 时间面板头部的格式化 | [token](#token) | 'YYYY-MM-DD' |
|
||||||
| time-picker-options | 设置固定时间去选择 | [time-picker-options](#time-picker-options) | null |
|
| time-picker-options | 设置固定时间去选择 | [time-picker-options](#time-picker-options) | null |
|
||||||
| prefix-class | 设置 class 的前缀 | `string` | 'mx' |
|
| prefix-class | 设置 class 的前缀 | `string` | 'mx' |
|
||||||
|
| scroll-duration | 设置滚动时候当选中小时的时候 | `number` | 100 |
|
||||||
|
|
||||||
#### Token
|
#### Token
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,10 @@ export default {
|
|||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
date: Date,
|
date: Date,
|
||||||
|
scrollDuration: {
|
||||||
|
type: Number,
|
||||||
|
default: 100,
|
||||||
|
},
|
||||||
getClasses: {
|
getClasses: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
@@ -125,7 +129,7 @@ export default {
|
|||||||
date: {
|
date: {
|
||||||
handler() {
|
handler() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.scrollToSelected(100);
|
this.scrollToSelected(this.scrollDuration);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
:hour-step="hourStep"
|
:hour-step="hourStep"
|
||||||
:minute-step="minuteStep"
|
:minute-step="minuteStep"
|
||||||
:second-step="secondStep"
|
:second-step="secondStep"
|
||||||
|
:scroll-duration="scrollDuration"
|
||||||
v-bind="ShowHourMinuteSecondAMPM"
|
v-bind="ShowHourMinuteSecondAMPM"
|
||||||
@select="handleSelect"
|
@select="handleSelect"
|
||||||
></list-columns>
|
></list-columns>
|
||||||
@@ -114,6 +115,10 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: undefined,
|
default: undefined,
|
||||||
},
|
},
|
||||||
|
scrollDuration: {
|
||||||
|
type: Number,
|
||||||
|
default: 100,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
innerValue() {
|
innerValue() {
|
||||||
|
|||||||
Reference in New Issue
Block a user