antd表单的<a-form-item>使用自定义label插槽

 item的label类型可以使字符串或者自定义label插槽。

1.直接使用字符串类型是最常见的

1
2
3
<a-form-model-item prop="job" label="岗位">
    <a-input v-model="job" placeholder="请输入岗位" />
</a-form-model-item>

 2.自定义label使用插槽

1
2
3
4
<a-form-model-item prop="job">
    <span slot="label" @click="$refs.modalData.showTableDetail">自定义label</span>
    <a-input v-model="job" placeholder="请输入岗位" />
</a-form-model-item>
posted @   岁月淡忘了谁  阅读(786)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2014-08-12 状态码常用对照表
点击右上角即可分享
微信分享提示