element/examples/docs/zh-CN/icon.md

103 lines
1.9 KiB
Markdown
Raw Normal View History

2016-07-27 14:15:02 +08:00
<script>
var iconList = require('examples/icon.json');
export default {
data() {
return {
icons: iconList
};
}
}
</script>
<style>
2016-09-18 22:01:26 +08:00
.demo-icon .source > i {
2017-12-12 12:45:09 +08:00
color: #606266;
2016-09-18 22:01:26 +08:00
margin: 0 20px;
font-size: 1.5em;
vertical-align: middle;
}
2016-09-18 22:01:26 +08:00
.demo-icon .source > button {
margin: 0 20px;
}
.page-component .content > ul.icon-list {
2016-07-27 14:15:02 +08:00
overflow: hidden;
list-style: none;
padding: 0;
2016-09-18 22:01:26 +08:00
border: solid 1px #eaeefb;
border-radius: 4px;
2016-07-27 14:15:02 +08:00
}
.icon-list li {
float: left;
2016-09-18 22:01:26 +08:00
width: 16.66%;
2016-07-27 14:15:02 +08:00
text-align: center;
height: 120px;
line-height: 120px;
color: #666;
font-size: 13px;
transition: color .15s linear;
border-right: 1px solid #eee;
border-bottom: 1px solid #eee;
margin-right: -1px;
margin-bottom: -1px;
@utils-vertical-center;
2017-10-18 16:12:54 +08:00
span {
2016-07-27 14:15:02 +08:00
display: inline-block;
line-height: normal;
vertical-align: middle;
2016-09-18 22:01:26 +08:00
font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;
color: #99a9bf;
2016-07-27 14:15:02 +08:00
}
2017-10-18 16:12:54 +08:00
i {
2016-07-27 14:15:02 +08:00
display: block;
2017-10-18 16:12:54 +08:00
font-size: 32px;
2016-07-27 14:15:02 +08:00
margin-bottom: 15px;
2017-12-12 12:45:09 +08:00
color: #606266;
2017-10-18 16:12:54 +08:00
}
.icon-name {
display: inline-block;
padding: 0 3px;
height: 1em;
2017-12-12 12:45:09 +08:00
color: #606266;
2016-07-27 14:15:02 +08:00
}
2017-10-18 16:12:54 +08:00
2016-07-27 14:15:02 +08:00
&:hover {
color: rgb(92, 182, 255);
}
}
</style>
## Icon 图标
2016-07-27 14:15:02 +08:00
2016-08-18 17:29:11 +08:00
提供了一套常用的图标集合。
2016-07-27 14:15:02 +08:00
### 使用方法
2016-07-27 14:15:02 +08:00
2016-09-07 18:46:20 +08:00
直接通过设置类名为 `el-icon-iconName` 来使用即可。例如:
2016-07-27 14:15:02 +08:00
:::demo
2016-07-27 14:15:02 +08:00
```html
<i class="el-icon-edit"></i>
<i class="el-icon-share"></i>
<i class="el-icon-delete"></i>
2017-10-19 12:11:47 +08:00
<el-button type="primary" icon="el-icon-search">搜索</el-button>
2016-07-27 14:15:02 +08:00
```
:::
2016-07-27 14:15:02 +08:00
### 图标集合
2016-07-27 14:15:02 +08:00
<ul class="icon-list">
2017-04-28 14:03:42 +08:00
<li v-for="name in icons" :key="name">
2016-07-27 14:15:02 +08:00
<span>
<i :class="'el-icon-' + name"></i>
2017-10-18 16:12:54 +08:00
<span class="icon-name">{{'el-icon-' + name}}</span>
2016-07-27 14:15:02 +08:00
</span>
</li>
</ul>