修改Element UI自帶的icon,替換成自己的圖片:
定義一個類名,icon使用類名:文章來源:http://www.zghlxwxcb.cn/news/detail-738775.html
.el-icon-類名 {
background: url('你的圖片路徑') center center no-repeat;
background-size: 24px;
}
如:文章來源地址http://www.zghlxwxcb.cn/news/detail-738775.html
.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;
}
<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>
到了這里,關(guān)于element 中使用自定義圖片icon圖標(biāo)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!