Commit 29a91fbb6133a937866e81e7b552ee079002a99c
1 parent
732b32e4
Correct passing of `confirm` prop, correct initial values when no value is passed
Showing
5 changed files
with
20 additions
and
20 deletions
Show diff stats
src/components/date-picker/base/time-spinner.vue
... | ... | @@ -28,15 +28,15 @@ |
28 | 28 | props: { |
29 | 29 | hours: { |
30 | 30 | type: [Number, String], |
31 | - default: 0 | |
31 | + default: NaN | |
32 | 32 | }, |
33 | 33 | minutes: { |
34 | 34 | type: [Number, String], |
35 | - default: 0 | |
35 | + default: NaN | |
36 | 36 | }, |
37 | 37 | seconds: { |
38 | 38 | type: [Number, String], |
39 | - default: 0 | |
39 | + default: NaN | |
40 | 40 | }, |
41 | 41 | showSeconds: { |
42 | 42 | type: Boolean, | ... | ... |
src/components/date-picker/panel/Date/date-panel-mixin.js
src/components/date-picker/panel/Time/time-range.vue
... | ... | @@ -10,9 +10,9 @@ |
10 | 10 | ref="timeSpinner" |
11 | 11 | :steps="steps" |
12 | 12 | :show-seconds="showSeconds" |
13 | - :hours="dateStart.getHours()" | |
14 | - :minutes="dateStart.getMinutes()" | |
15 | - :seconds="dateStart.getSeconds()" | |
13 | + :hours="value[0] && dateStart.getHours()" | |
14 | + :minutes="value[0] && dateStart.getMinutes()" | |
15 | + :seconds="value[0] && dateStart.getSeconds()" | |
16 | 16 | :disabled-hours="disabledHours" |
17 | 17 | :disabled-minutes="disabledMinutes" |
18 | 18 | :disabled-seconds="disabledSeconds" |
... | ... | @@ -29,9 +29,9 @@ |
29 | 29 | ref="timeSpinnerEnd" |
30 | 30 | :steps="steps" |
31 | 31 | :show-seconds="showSeconds" |
32 | - :hours="dateEnd.getHours()" | |
33 | - :minutes="dateEnd.getMinutes()" | |
34 | - :seconds="dateEnd.getSeconds()" | |
32 | + :hours="value[1] && dateEnd.getHours()" | |
33 | + :minutes="value[1] && dateEnd.getMinutes()" | |
34 | + :seconds="value[1] && dateEnd.getSeconds()" | |
35 | 35 | :disabled-hours="disabledHours" |
36 | 36 | :disabled-minutes="disabledMinutes" |
37 | 37 | :disabled-seconds="disabledSeconds" |
... | ... | @@ -87,8 +87,7 @@ |
87 | 87 | timePrefixCls: timePrefixCls, |
88 | 88 | showDate: false, |
89 | 89 | dateStart: dateStart || initTimeDate(), |
90 | - dateEnd: dateEnd || initTimeDate(), | |
91 | - confirm: false | |
90 | + dateEnd: dateEnd || initTimeDate() | |
92 | 91 | }; |
93 | 92 | }, |
94 | 93 | computed: { | ... | ... |
src/components/date-picker/panel/Time/time.vue
... | ... | @@ -7,9 +7,9 @@ |
7 | 7 | ref="timeSpinner" |
8 | 8 | :show-seconds="showSeconds" |
9 | 9 | :steps="steps" |
10 | - :hours="date.getHours()" | |
11 | - :minutes="date.getMinutes()" | |
12 | - :seconds="date.getSeconds()" | |
10 | + :hours="value[0] && date.getHours()" | |
11 | + :minutes="value[0] && date.getMinutes()" | |
12 | + :seconds="value[0] && date.getSeconds()" | |
13 | 13 | :disabled-hours="disabledHours" |
14 | 14 | :disabled-minutes="disabledMinutes" |
15 | 15 | :disabled-seconds="disabledSeconds" |
... | ... | @@ -63,8 +63,7 @@ |
63 | 63 | prefixCls: prefixCls, |
64 | 64 | timePrefixCls: timePrefixCls, |
65 | 65 | date: this.value[0] || initTimeDate(), |
66 | - showDate: false, | |
67 | - confirm: false | |
66 | + showDate: false | |
68 | 67 | }; |
69 | 68 | }, |
70 | 69 | computed: { | ... | ... |
src/components/date-picker/panel/panel-mixin.js