ant-design-vue的form表单labelCol属性固定宽度

文档里 form 表单的 labelCol 属性只写了 {span: 3, offset: 12} 的用法,和参考 Grid Col 的属性参数,并没有说可以设置 style 属性和用法。

其实可以这么设置:

:labelCol="{ style: ' 100px' }"

  

这是在/form/FormItem.jsx 源码里找到了 labelCol 属性的接收参数,才知道正确用法。

const {
class: labelColClass,
style: labelColStyle,
id: labelColId,
on,
...restProps
} = mergedLabelCol;

感谢@github vhkdiy

原文:https://github.com/vueComponent/ant-design-vue/issues/3042

原文地址:https://www.cnblogs.com/deajax/p/14142160.html