Skip to content

Commit 2d909c0

Browse files
author
陈雪冬
committed
功能优化
1 parent 15a98b4 commit 2d909c0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

components/date-picker/RangePicker.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ export default {
409409
openChange: this.handleOpenChange,
410410
},
411411
style: popupStyle,
412-
scopedSlots: $scopedSlots.default ? $scopedSlots : null,
412+
scopedSlots: { default: input, ...$scopedSlots },
413413
},
414414
);
415415
return (
@@ -423,7 +423,7 @@ export default {
423423
onMouseenter={this.onMouseEnter}
424424
onMouseleave={this.onMouseLeave}
425425
>
426-
<VcDatePicker {...vcDatePickerProps}>{$scopedSlots.default ? '' : input}</VcDatePicker>
426+
<VcDatePicker {...vcDatePickerProps} />
427427
</span>
428428
);
429429
},

components/date-picker/createPicker.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export default function createPicker(TheCalendar, props) {
244244
onOpenChange: this.handleOpenChange,
245245
},
246246
style: props.popupStyle,
247-
scopedSlots: $scopedSlots.default ? $scopedSlots : null,
247+
scopedSlots: { default: input, ...$scopedSlots },
248248
};
249249
return (
250250
<span
@@ -256,7 +256,7 @@ export default function createPicker(TheCalendar, props) {
256256
onMouseenter={this.onMouseEnter}
257257
onMouseleave={this.onMouseLeave}
258258
>
259-
<VcDatePicker {...vcDatePickerProps}>{$scopedSlots.default ? '' : input}</VcDatePicker>
259+
<VcDatePicker {...vcDatePickerProps} />
260260
</span>
261261
);
262262
},

components/date-picker/demo/text.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
<cn>
33
#### 自定义渲染
4-
增加选择时间功能,当 `showTime` 为一个对象时,其属性会传递给内建的 `TimePicker`
4+
增加自定义渲染功能,在默认 `slot` 中,你可以设置任何你想渲染的组件
55
</cn>
66

77
<us>
88
#### Custum Time
9-
This property provide an additional time selection. When `showTime` is an Object, its properties will be passed on to built-in `TimePicker`.
9+
Added custom rendering function, in the default `slot', you can set any component you want to render..
1010
</us>
1111

1212
```html

0 commit comments

Comments
 (0)