-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from appletxm/1004431-icons
1004431 icons
- Loading branch information
Showing
21 changed files
with
281 additions
and
33 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17055,7 +17055,6 @@ textarea { | |
|
||
.container, | ||
.page-container { | ||
width: 1140px; | ||
padding: 0; | ||
margin: 0 auto | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<script> | ||
import DemoBlock from 'components-biz/demo-block' | ||
|
||
export default { | ||
created() { | ||
this.$getAllIcons() | ||
}, | ||
mounted() {}, | ||
components: { | ||
DemoBlock | ||
}, | ||
methods: { | ||
$getAllIcons() { | ||
axios.get('/api/iconsList/get').then(res => { | ||
this.iconsList = res.data.icons | ||
}).catch(err => { | ||
console.info('$getAllIcons:', err) | ||
}) | ||
} | ||
}, | ||
data() { | ||
return { | ||
iconsList: [] | ||
} | ||
}, | ||
watch: {} | ||
} | ||
</script> | ||
|
||
<template> | ||
<h2>Icon 图标</h2> | ||
<p>提供了一套常用的图标集合。</p> | ||
<h3>使用方法</h3> | ||
<p>与标准的html标签使用</p> | ||
<demo-block class="hf-ui-doc-icon"> | ||
<div slot="source" class="icon-html-example"> | ||
<span class="hf-ui-icon ui-icon-home"></span> | ||
<span class="hf-ui-icon ui-icon-arrowdown"></span> | ||
</div> | ||
<template slot="highlight"> | ||
<pre> | ||
<code class="html hljs xml"> | ||
<span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"hf-ui-icon ui-icon-home"</span>></span><span class="hljs-tag"></<span class="hljs-name">span</span>></span> | ||
<span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"hf-ui-icon ui-icon-arrowdown"</span>></span><span class="hljs-tag"></<span class="hljs-name">span</span>></span> | ||
</code> | ||
</pre> | ||
</template> | ||
</demo-block> | ||
<p>与组件使用</p> | ||
<demo-block class="hf-ui-doc-icon"> | ||
<div slot="source"> | ||
<hf-ui-button size="big" icon="ui-icon-home" type="primary">回主页</hf-ui-button> | ||
<hf-ui-icon icon="ui-icon-home"></hf-ui-icon> | ||
</div> | ||
<div slot="highlight"> | ||
<pre> | ||
<code class="html hljs xml"> | ||
<span class="hljs-tag"><<span class="hljs-name">hf-ui-button</span> <span class="hljs-attr">size</span>=<span class="hljs-string">"big"</span> <span class="hljs-attr">icon</span>=<span class="hljs-string">"ui-icon-home"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"primary"</span>></span><span class="hljs-tag"></<span class="hljs-name">hf-ui-button</span>></span> | ||
<span class="hljs-tag"><<span class="hljs-name">hf-ui-icon</span> <span class="hljs-attr">icon</span>=<span class="hljs-string">"ui-icon-home"</span>></span><span class="hljs-tag"></<span class="hljs-name">hf-ui-icon</span>></span> | ||
</code> | ||
</pre> | ||
</div> | ||
</demo-block> | ||
<h3 id="attributes"><a href="#attributes" aria-hidden="true" class="header-anchor">¶</a>Attributes</h3> | ||
<table> | ||
<thead> | ||
<tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr> | ||
</thead> | ||
<tbody> | ||
<tr><td>icon</td> <td>以下图标集合对应图标名称</td> <td>string</td> <td>-</td> <td>-</td></tr> | ||
</tbody> | ||
</table> | ||
<h3>图标集合</h3> | ||
<div class="rf-ui-doc-icon-list"> | ||
<ul> | ||
<li v-for="(icon, index) in iconsList" :key="index"> | ||
<span :class="['hf-ui-icon', icon.class]"></span> | ||
<i>{{icon.label}}</i> | ||
</li> | ||
</ul> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.hf-ui-doc-icon { | ||
.icon-html-example { | ||
.hf-ui-icon { | ||
padding: 10px; | ||
&:before { | ||
font-size: $font-24; | ||
} | ||
} | ||
} | ||
|
||
.html{ | ||
margin: -30px auto auto -70px!important; | ||
} | ||
} | ||
|
||
.rf-ui-doc-icon-list { | ||
margin-bottom: 20px; | ||
ul { | ||
list-style: none; | ||
display: flex; | ||
align-items: flex-start; | ||
flex-wrap: wrap; | ||
border: 1px solid $clr-border-color; | ||
border-radius: 3px; | ||
|
||
li { | ||
width: 150px; | ||
height: 100px; | ||
text-align: center; | ||
color: $clr-font-text-color; | ||
@include transition(all .5s ease); | ||
|
||
.hf-ui-icon { | ||
display: block; | ||
line-height: 60px; | ||
font-weight: 600; | ||
&:before { | ||
font-size: $font-24; | ||
} | ||
} | ||
i { | ||
font-style: normal; | ||
} | ||
|
||
&:hover { | ||
color: $clr-error-color; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const path = require('path') | ||
const fs = require('fs') | ||
|
||
const srcPath = './src/theme/iconfont.css' | ||
|
||
function getIcons(req, res) { | ||
const iconCssFile = fs.readFileSync(path.resolve(srcPath), 'utf8') | ||
const reg = /\ui-icon-[^\:\;\}\]\]\"]+/g | ||
const matchObj = iconCssFile.match(reg) | ||
let resIconList = [] | ||
|
||
matchObj.forEach(item => { | ||
resIconList.push({ | ||
label: item, | ||
class: item | ||
}) | ||
}) | ||
|
||
res.set('content-type', 'application/json') | ||
res.send(JSON.stringify({ | ||
code: 200, | ||
icons: resIconList | ||
})) | ||
} | ||
|
||
module.exports = { | ||
getIcons | ||
} |
Oops, something went wrong.