当前位置:   article > 正文

vue中element-ui中的el-button自定义icon图标_el-button icon

el-button icon

实现:

button的icon属性自定义一个图标名称,这个自定义的图标名称会默认添加到button下i标签的class上,我们只需要设置i标签的样式就可以了。

1. 控制台显示的代码

2 .图片展示

 3. 按钮上使用自定义的icon

完整代码:

  1. <el-button icon="el-icon-my-message" size="mini" type="primary">
  2. 查看
  3. </el-button>

样式代码: 

  1. ::v-deep .el-icon-my-message {
  2. background: url('../../assets/images/lookMsg.png') center no-repeat;
  3. width: 21px;
  4. height: 26px;
  5. }
  6. ::v-deep .el-icon-my-message:before {
  7. content: "替";
  8. font-size: 20px;
  9. visibility: hidden;
  10. }
  11. ::v-deep .el-icon-my-message {
  12. font-size: 16px;
  13. }
  14. ::v-deep .el-icon-my-message:before {
  15. content: "\e611";
  16. }

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号