Change views/icons path

- Icons view includes 2 small views: svg-icons and element-icons
This commit is contained in:
Tuan Duong 2019-04-17 00:01:24 +07:00
parent c00564617e
commit 6a08c79bfb
5 changed files with 82 additions and 9 deletions

View File

@ -163,7 +163,7 @@ export const asyncRoutes = [
children: [ children: [
{ {
path: 'index', path: 'index',
component: () => import('@/views/svg-icons/index'), component: () => import('@/views/icons/index'),
name: 'Icons', name: 'Icons',
meta: { title: 'icons', icon: 'icon', noCache: true } meta: { title: 'icons', icon: 'icon', noCache: true }
} }

View File

@ -0,0 +1,74 @@
const elementIcons = [
'info',
'error',
'success',
'warning',
'question',
'back',
'arrow-left',
'arrow-down',
'arrow-right',
'arrow-up',
'caret-left',
'caret-bottom',
'caret-top',
'caret-right',
'd-arrow-left',
'd-arrow-right',
'minus',
'plus',
'remove',
'circle-plus',
'remove-outline',
'circle-plus-outline',
'close',
'check',
'circle-close',
'circle-check',
'circle-close-outline',
'circle-check-outline',
'zoom-out',
'zoom-in',
'd-caret',
'sort',
'sort-down',
'sort-up',
'tickets',
'document',
'goods',
'sold-out',
'news',
'message',
'date',
'printer',
'time',
'bell',
'mobile-phone',
'service',
'view',
'menu',
'more',
'more-outline',
'star-on',
'star-off',
'location',
'location-outline',
'phone',
'phone-outline',
'picture',
'picture-outline',
'delete',
'search',
'edit',
'edit-outline',
'rank',
'refresh',
'share',
'setting',
'upload',
'upload2',
'download',
'loading'
]
export default elementIcons

View File

@ -6,7 +6,7 @@
</aside> </aside>
<el-tabs type="border-card"> <el-tabs type="border-card">
<el-tab-pane label="Icons"> <el-tab-pane label="Icons">
<div v-for="item of iconsMap" :key="item" @click="handleClipboard(generateIconCode(item),$event)"> <div v-for="item of svgIcons" :key="item" @click="handleClipboard(generateIconCode(item),$event)">
<el-tooltip placement="top"> <el-tooltip placement="top">
<div slot="content"> <div slot="content">
{{ generateIconCode(item) }} {{ generateIconCode(item) }}
@ -37,15 +37,15 @@
<script> <script>
import clipboard from '@/utils/clipboard' import clipboard from '@/utils/clipboard'
import icons from './require-icons' import svgIcons from './svg-icons'
import elementIcons from './element-icon.json' import elementIcons from './element-icons'
export default { export default {
name: 'Icons', name: 'Icons',
data() { data() {
return { return {
iconsMap: icons, svgIcons,
elementIcons: elementIcons elementIcons
} }
}, },
methods: { methods: {

View File

@ -3,8 +3,8 @@ const requireAll = requireContext => requireContext.keys()
const re = /\.\/(.*)\.svg/ const re = /\.\/(.*)\.svg/
const icons = requireAll(req).map(i => { const svgIcons = requireAll(req).map(i => {
return i.match(re)[1] return i.match(re)[1]
}) })
export default icons export default svgIcons

View File

@ -1 +0,0 @@
["info","error","success","warning","question","back","arrow-left","arrow-down","arrow-right","arrow-up","caret-left","caret-bottom","caret-top","caret-right","d-arrow-left","d-arrow-right","minus","plus","remove","circle-plus","remove-outline","circle-plus-outline","close","check","circle-close","circle-check","circle-close-outline","circle-check-outline","zoom-out","zoom-in","d-caret","sort","sort-down","sort-up","tickets","document","goods","sold-out","news","message","date","printer","time","bell","mobile-phone","service","view","menu","more","more-outline","star-on","star-off","location","location-outline","phone","phone-outline","picture","picture-outline","delete","search","edit","edit-outline","rank","refresh","share","setting","upload","upload2","download","loading"]