add icon tips

This commit is contained in:
Pan 2017-08-29 18:04:48 +08:00 committed by 花裤衩
parent 90fd4328b7
commit c182a119e1
2 changed files with 9 additions and 3 deletions

View File

@ -2,11 +2,11 @@ import Vue from 'vue'
import IconSvg from '@/components/Icon-svg'// svg组件
import generateIconsView from '@/views/svg-icons/generateIconsView.js'// just for views/icons , you can delete it
// register globally
Vue.component('icon-svg', IconSvg)
const requireAll = requireContext => requireContext.keys().map(requireContext)
const req = require.context('./svg', false, /\.svg$/)
const iconMap = requireAll(req)
console.log(generateIconsView)
generateIconsView.generate(iconMap) // just for views/icons , you can delete it

View File

@ -2,7 +2,12 @@
<div class="icons-container">
<div class="icons-wrapper">
<div v-for='item of iconsMap' :key='item' class='icon-item'>
<el-tooltip placement="top" effect="light">
<div slot="content">
{{`&lt;icon-svg :icon-class=&quot;${item}&quot; /&gt;`}}
</div>
<icon-svg :icon-class="item" />
</el-tooltip>
<span>{{item}}</span>
</div>
</div>
@ -42,6 +47,7 @@ export default {
float: left;
font-size: 40px;
color: #666;
cursor: pointer;
}
span {
display: block;