Ant-design-vue: a-form-item中的lable长度不一时,希望类似table那样能label对其,后面的input长度一致

Created on 27 May 2019  ·  4Comments  ·  Source: vueComponent/ant-design-vue

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

页面整齐

What does the proposed API look like?

这个应该不需要特别的设置,应该文本标签的长度要一致

Most helpful comment

非常需要label-width属性

All 4 comments

labelCol: {
        xs: { span: 24 },
        sm: { span: 7 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 13 }
      },

image

然后 label 设定某一个方向对齐,应该就符合了。

非常需要label-width属性

my way on 1.6.5
hack FormItem renderFormItem() with

return ( <a-row  type="flex" ..."

then you can use FormItem like this way

        <a-form-item
          label="Form Layout"
          :label-col="{ flex: '500px' }"
          :wrapper-col="{ flex: 'auto' }"
    >

work on 1.7.2

<!-- '8rem'/'24rem' is actually label/wrapper width -->
<a-form-model ref="form" :model="searchModel" :rules="searchModelRules" :label-col="{span:1,style:'width:8rem'}" :wrapper-col="{span:1,style:'width:24rem'}" />
Was this page helpful?
0 / 5 - 0 ratings