alibaba / x-render

🚴‍♀️ 阿里 - 很易用的中后台「表单 / 表格 / 图表」解决方案

Home Page:https://xrender.fun

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

不支持AllowClear触发Form的onChange更新

hulk4fe opened this issue · comments

commented

{
type: 'object',
displayType: 'column',
properties: {
metadataKey: {
title: ‘标题’,
type: 'string',
props: {
placeholder: '请输入内容搜索',
allowClear: true,
onClear: () => {}
onChange: () => {}
....

return

这里如果要实现表单搜索时单项支持清空时,给props加了allowClear后,点击清空onFormChange无法监听到值的清空变化,如果改为在props里面onChange监听,是可以的,但是在onFormChange中拿到的values是空,且form.getFeildsValue拿到的也是空,而且你们官方文档也不建议使用组件的onChange事件,此时我又想到antd@4.6后支持onClear事件,但是onClear事件根本不触发(这里不确定是xrender覆盖行为还是其他。。。)

commented

或者通过全局的 watch 监听