Replies: 1 comment
-
建议你自己看下input组件的源码会相对来说简单一些,实现方式是一样的 const elForm = inject(elFormKey, {} as ElFormContext)
const elFormItem = inject(elFormItemKey, {} as ElFormItemContext)
// ....
elFormItem.formItemMitt?.emit('el.form.blur', [props.modelValue])
// or
elFormItem.formItemMitt?.emit('el.form.change', [props.modelValue])
// ... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
因为目前没有提供Tree-Select控件,所以自己用Input、Popover和Tree组件封装了一个TreeSelect。
但是在放到Form中做表单验证(required)时,点击TreeNode后是先触发验证(blur事件),再触发update:modelValue,导致每次验证的值都是上一次选择的值,但我发现Select组件并不会出现这样的问题。
看了Select源码照着写,也没能解决。
故在此想问下作者们,Select组件是如何实现选择后,Form能先获取到新的值,再做验证?
谢谢了!!!🙏
Beta Was this translation helpful? Give feedback.
All reactions