ant-design-vue/components/auto-complete/InputElement.tsx

10 lines
328 B
TypeScript
Raw Normal View History

2019-01-12 03:33:27 +00:00
import { cloneElement } from '../_util/vnode';
2020-07-01 16:24:44 +00:00
import { flattenChildren } from '../_util/props-util';
2020-10-12 10:46:05 +00:00
const InputElement = (_: any, { attrs, slots }) => {
2020-07-01 16:24:44 +00:00
const children = flattenChildren(slots.default?.())[0];
return cloneElement(children, { ...attrs });
2019-01-12 03:33:27 +00:00
};
2020-07-01 16:24:44 +00:00
InputElement.inheritAttrs = false;
export default InputElement;