no message
Former-commit-id: e53eb6f9a1aec5c29922346342f0f1490a8dee22 Former-commit-id: 5952c33f74a3221ffcdcd43d5e5fd785b8d37aef Former-commit-id: f95df5675d25421fe527c4ac3b77140f24ab5341
This commit is contained in:
@@ -1,17 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<Container>
|
<Container type="ghost">
|
||||||
<PageHeader
|
<el-card class="dd-mb">
|
||||||
slot="header"
|
<PageHeader
|
||||||
title="SVG图标组件">
|
slot="header"
|
||||||
</PageHeader>
|
title="SVG图标组件">
|
||||||
<el-row>
|
</PageHeader>
|
||||||
<el-col class="icon-card" :span="4" v-for="(icon, index) in $IconSvg" :key="index">
|
<el-row>
|
||||||
<IconSvg class="icon" :name="icon"></IconSvg>
|
<el-col class="icon-card" :span="4" v-for="(icon, index) in $IconSvg" :key="index">
|
||||||
<div class="icon-title">
|
<IconSvg class="icon" :name="icon"></IconSvg>
|
||||||
<span>{{icon}}</span>
|
<div class="icon-title">
|
||||||
</div>
|
<span>{{icon}}</span>
|
||||||
</el-col>
|
</div>
|
||||||
</el-row>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
<el-card>
|
||||||
|
<Markdown url="/static/markdownFiles/article/组件 - 图标组件.md"></Markdown>
|
||||||
|
</el-card>
|
||||||
</Container>
|
</Container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -23,16 +28,23 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 150px;
|
height: 150px;
|
||||||
|
&:hover {
|
||||||
|
.icon {
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
.icon-title {
|
||||||
|
color: $color-text-main;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.icon {
|
.icon {
|
||||||
height: 80px;
|
height: 80px;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
|
transition: all .3s;
|
||||||
}
|
}
|
||||||
.icon-title {
|
.icon-title {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
span {
|
color: $color-text-placehoder;
|
||||||
color: $color-text-sub;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
35
static/markdownFiles/article/组件 - 图标组件 - svg.md
Normal file
35
static/markdownFiles/article/组件 - 图标组件 - svg.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
## 参数
|
||||||
|
|
||||||
|
| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 |
|
||||||
|
| --- | --- | --- | --- | --- | --- |
|
||||||
|
| name | 图标名称 | 非 | String | font-awesome 所有图标名 | 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>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 参考
|
||||||
|
|
||||||
|
演示图表来源 [http://iconfont.cn/ @小啊小二饼 《2.5D工作日记》](http://iconfont.cn/collections/detail?spm=a313x.7781069.1998910419.d9df05512&cid=8219)
|
||||||
Reference in New Issue
Block a user