表单el-form-item自定义label
核心用的是 slot='label'
// label-width="20px"设置标签宽度
<div class="bottom_img">
<el-form label-width="20px">
<el-form-item prop="password">
<span slot="label">
//这里用图片 文字都可以
<img src="xxx" alt=""/>
</span>
<el-input placeholder="请输入密码" model="logoform.password" show-password class="pass_input"></el-input>
</el-form-item>
</el-form>
</div>
<style lang="less" scoped>
.bottom_img {
height: 50px;
width: 260px;
line-height: 50px;
img {
width: 20px;
height: 24px;
float: left;
margin-top: 13px;
}
.pass_input {
float: left;
width: 240px;
& /deep/ .el-input__inner {
border: none;
height: 47px;
font-size: 16px;
}
& /deep/ .el-input__clear {
font-size: 18px;
}
}
}
</style>
效果图: