Former-commit-id: 6f3e0348fee130dd6a4d0261b3ee54640b791696 Former-commit-id: 483bfee1d9db62bacbddc7132c2392ce17e8c7d5 Former-commit-id: ad5232f9be60e5c0817819968ba687c1058b98a9
54 lines
1.1 KiB
Markdown
54 lines
1.1 KiB
Markdown
## 参数
|
|
|
|
| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 |
|
|
| --- | --- | --- | --- | --- | --- |
|
|
| name | 图标名称 | 非 | String | font-awesome 所有图标名 | font-awesome |
|
|
|
|
## 使用方法
|
|
|
|
基本
|
|
|
|
```
|
|
// 并无卵用的使用方式 等于 name="font-awesome"
|
|
<Icon></Icon>
|
|
// 指定图标名称
|
|
<Icon name="github"></Icon>
|
|
// 设置行内样式
|
|
<Icon name="github" style="font-size: 100px;"></Icon>
|
|
// 设置 class
|
|
<Icon name="github" class="icon-class-demo"></Icon>
|
|
```
|
|
|
|
这个组件只是简化了写法而已
|
|
|
|
```
|
|
<Icon name="github"></Icon>
|
|
// 等同于
|
|
<i class="fa fa-github" aria-hidden="true"></i>
|
|
```
|
|
|
|
## 参考
|
|
|
|
图标索引
|
|
|
|
[Font Awesome 中文网](http://www.fontawesome.com.cn/faicons/)
|
|
|
|
[fontawesome.com](https://fontawesome.com/icons?d=gallery)
|
|
|
|
PS. 示例中最后一个图标的样式 `SCSS`
|
|
|
|
```
|
|
<style lang="scss">
|
|
.icon-class-demo {
|
|
transition: all .3s;
|
|
font-size: 100px;
|
|
color: #409EFF;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
&:hover{
|
|
color: #F56C6C;
|
|
transform: scale(1.2) rotate(30deg);
|
|
}
|
|
}
|
|
</style>
|
|
``` |