Browse Source

fix: formitem error when use native tag #4383

close #4383
pull/4385/head
tangjinzhou 3 years ago
parent
commit
b5ab14df8d
  1. 2
      components/form/FormItem.tsx
  2. 2
      v2-doc

2
components/form/FormItem.tsx

@ -306,7 +306,7 @@ export default defineComponent({
const children = flattenChildren(slots.default?.()); const children = flattenChildren(slots.default?.());
let firstChildren = children[0]; let firstChildren = children[0];
if (fieldName.value && props.autoLink && isValidElement(firstChildren)) { if (fieldName.value && props.autoLink && isValidElement(firstChildren)) {
const originalEvents = firstChildren.props; const originalEvents = firstChildren.props || {};
const originalBlur = originalEvents.onBlur; const originalBlur = originalEvents.onBlur;
const originalChange = originalEvents.onChange; const originalChange = originalEvents.onChange;
firstChildren = cloneElement(firstChildren, { firstChildren = cloneElement(firstChildren, {

2
v2-doc

@ -1 +1 @@
Subproject commit 57c08127bf0e3e826b03f845df3e1332820964e5 Subproject commit fc73e64bcdf41be854c2f7a907c05b056ad652ab
Loading…
Cancel
Save