Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛[BUG] renderFormItem注入了placeholder属性 #6110

Closed
jaykou25 opened this issue Oct 21, 2022 · 2 comments
Closed

🐛[BUG] renderFormItem注入了placeholder属性 #6110

jaykou25 opened this issue Oct 21, 2022 · 2 comments

Comments

@jaykou25
Copy link

RenderFormItem自动注入了placeholder 请输入 对于Select等组件并不友好

renderFormItem可以对valueType里的组件类型自动注入placeholder, 但是对于用户自定义的组件还是不要自动注入为好.

现在的情况是我封装了一个select组件, 但是在renderFormItem里被强行加入了placeholder属性, 我只能一个一个手动加入placeholder来覆盖自动注入的属性. 用的地方多了就不太方便.

希望理解😅

renderFormItem

@chenshuai2144
Copy link
Contributor

chenshuai2144 commented Oct 26, 2022

你都自定义了,自己设置一下吧,默认行为是为了满足大部分人的

@jaykou25
Copy link
Author

jaykou25 commented Oct 28, 2022

你都自定义了,自己设置一下吧,默认行为是为了满足大部分人的

自定义组件的话除非写死placeholder, 如果想要提供一个默认值, 用户又可以输入的话, 默认值始终会被注入的请输入覆盖.

用户如果仅输入了title跟dataIndex, 默认渲染一个input并且带上placeholder没问题.

{
  title: '默认',
  dataIndex: 'default'
}

但是在renderFormItem里感觉没必要自动带上placeholder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants