定义样式
<style>
.el-icon-my-export {
background: url('../assets/icon/shenhe.png') center no-repeat;
background-size: cover;
}
.el-icon-my-export:before {
content: "\66ff";
font-size: 16px;
visibility: hidden;
}
.el-icon-my-export {
font-size: 16px;
}
.el-icon-my-export:before {
content: "\e641";
}
</style>
引用
<i class="el-icon-my-export"></i>
<el-button icon="el-icon-my-export" circle></el-button>
完整代码
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<title></title>
<style>
.el-icon-my-export {
background: url('../assets/icon/shenhe.png') center no-repeat;
background-size: cover;
}
.el-icon-my-export:before {
content: "\66ff";
font-size: 16px;
visibility: hidden;
}
.el-icon-my-export {
font-size: 16px;
}
.el-icon-my-export:before {
content: "\e641";
}
</style>
</head>
<body>
<div id="app">
<i class="el-icon-my-export"></i>
<el-button icon="el-icon-my-export" circle></el-button>
</div>
<script>
new Vue({
el: '#app',
data: {
}
})
</script>
</body>
</html>
效果图
