el-button设置图标
时间: 2023-10-01 07:07:42 浏览: 149
el-button可以通过设置icon属性来自定义图标。在代码中,可以使用<i>标签来定义图标,并将自定义的图标名称添加到<i>标签的class属性上。然后,可以通过设置<i>标签的样式来显示自定义的图标。例如,可以使用以下代码来设置el-button的图标:
```html
<el-button @click="to_devops(scope.row.pr_url)">
<i class="el-icon-devops"></i>
</el-button>
```
在CSS中,可以使用以下样式来设置el-icon-devops的样式:
```css
.el-icon-devops {
background: url('../../../assets/devops.png') center no-repeat;
font-size: 12px;
background-size: cover;
}
.el-icon-devops:before {
content: "替";
font-size: 12px;
visibility: hidden;
}
```
这样就可以在el-button中设置自定义的图标了。
#### 引用[.reference_title]
- *1* [element button自定义图标](https://blog.csdn.net/weixin_44157964/article/details/120785629)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [直播源码开发,el-button自定义图片显示](https://blog.csdn.net/yb1314111/article/details/128613964)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [el-button自定义图片显示](https://blog.csdn.net/changyana/article/details/127647388)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文