feat: ele 新增 RangePicker 和 getRangePickerDefaultProps 适配
This commit is contained in:
@@ -176,6 +176,7 @@ export type ComponentType =
|
||||
| 'Input'
|
||||
| 'InputNumber'
|
||||
| 'RadioGroup'
|
||||
| 'RangePicker'
|
||||
| 'RichTextarea'
|
||||
| 'Select'
|
||||
| 'Space'
|
||||
@@ -299,6 +300,26 @@ async function initComponentAdapter() {
|
||||
slots,
|
||||
);
|
||||
},
|
||||
RangePicker: (props, { attrs, slots }) => {
|
||||
const { name, id } = props;
|
||||
const extraProps: Recordable<any> = {};
|
||||
if (name && !Array.isArray(name)) {
|
||||
extraProps.name = [name, `${name}_end`];
|
||||
}
|
||||
if (id && !Array.isArray(id)) {
|
||||
extraProps.id = [id, `${id}_end`];
|
||||
}
|
||||
return h(
|
||||
ElDatePicker,
|
||||
{
|
||||
...props,
|
||||
type: 'datetimerange',
|
||||
...attrs,
|
||||
...extraProps,
|
||||
},
|
||||
slots,
|
||||
);
|
||||
},
|
||||
DatePicker: (props, { attrs, slots }) => {
|
||||
const { name, id, type } = props;
|
||||
const extraProps: Recordable<any> = {};
|
||||
|
||||
Reference in New Issue
Block a user