-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Description
- I have searched the issues of this repository and believe that this is not a duplicate.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
What problem does this feature solve?
之前使用 element 等 组件库的时候,发现 labelWidth 这个属性体验舒适,自己写组件库的时候也发现这个属性提供继承和 item 优先级更高的 API 蛮好的。
我目前能想到的是因为 ant design react 的没有实现,然后 vue 的为了保持 api 一致所以也没有提供😂
说一个技术实现上的小点,当然您估计更清楚,用 provide 和 inject 可以很方便地实现这种 API。
当使用 labelCol 和 wrapperCol 进行表单布局的时候,发现了两个不适:
- 表单过多时,可以说是两个及以上时,就发现出现重复代码,如果更多时,不适感更强,虽然可以通过抽象具体代码或通过 for 循环做一些代码瘦身。
- 使用这两个属性布局时,当页面宽度动态改变时,有时会发生 label 被表单空间遮盖问题,label没有自动换行(这个应该可以通过 css 解决,或通过组件库种的其他 API 解决,没有详细了解)
另外,一般情况下表单元素都是相同的 labelWidth 以保持布局对齐,所以 父组件(Form)提供控制 (Form.Item)的布局能力个人觉得蛮好的。
What does the proposed API look like?
建议提供 Form 直接管理表单布局的能力
tangjinzhou, atzcl, nian0114, nongzhenli, EmptyG2018 and 5 more
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
tangjinzhou commentedon Feb 22, 2019
ref ant-design/ant-design#15006
zzzz-Z commentedon Apr 4, 2019
这是我自己的实现
zzzz-Z commentedon Apr 4, 2019
github-actions commentedon Feb 25, 2021
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days