关于前端:elementui-配置iconfont

4次阅读

共计 539 个字符,预计需要花费 2 分钟才能阅读完成。

在 iconfont.cn 抉择好我的项目须要的 icon,增加进我的项目,下载好 font 文件,而后在

全局 scss 代码里写上:
@font-face {
  font-family: "zr";
  src: url('../icon/download.ttf') format('truetype');
}

.zr {
  font-family: zr!important;
  font-style: normal;
  font-weight: 400;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  vertical-align: baseline;
  display: inline-block;
  -webkit-font-smoothing: antialiased;
}

.icon-download:before {content: "\e635";}

.icon-imp:before {content: "\e6fd";}
应用:
 <el-button
    size="mini"
    icon="zr icon-imp"
    @click="handleImp(scope.$index, scope.row)"
    :disabled="scope.row.state === 1"
  >
    导入
  </el-button>
正文完
 0