修改Element UI自带的icon,替换成自己的图片:
定义一个类名,icon使用类名:
.el-icon-类名 {
background: url('你的图片路径') center center no-repeat;
background-size: 24px;
}
如:
.el-icon-date {
background: url('../../../assets/icon/icon-date.png') center center no-repeat;
background-size: 16px;
}
.el-icon-price {
background: url('../../../assets/icon/icon-price.png') center center no-repeat;
background-size: 16px;
}
.el-icon-arrow {
background: url('../../../assets/icon/icon-arrow.png') center center no-repeat;
background-size: 16px;
}
javascript"><el-form-item class="formSelect" label="建议销售价">
<el-col :span="11">
<el-input placeholder="最低价" v-model="searchInfo.minSellPrice"
suffix-icon="el-icon-arrow">
</el-input>
</el-col>
<el-col class="line" :span="2">-</el-col>
<el-col :span="11">
<el-input placeholder="最高价" v-model="searchInfo.maxSellPrice"
suffix-icon="el-icon-price">
</el-input>
</el-col>
</el-form-item>