作者 RuoYi

删除无用的代码

1 -const elementIcons = ['platform-eleme', 'eleme', 'delete-solid', 'delete', 's-tools', 'setting', 'user-solid', 'user', 'phone', 'phone-outline', 'more', 'more-outline', 'star-on', 'star-off', 's-goods', 'goods', 'warning', 'warning-outline', 'question', 'info', 'remove', 'circle-plus', 'success', 'error', 'zoom-in', 'zoom-out', 'remove-outline', 'circle-plus-outline', 'circle-check', 'circle-close', 's-help', 'help', 'minus', 'plus', 'check', 'close', 'picture', 'picture-outline', 'picture-outline-round', 'upload', 'upload2', 'download', 'camera-solid', 'camera', 'video-camera-solid', 'video-camera', 'message-solid', 'bell', 's-cooperation', 's-order', 's-platform', 's-fold', 's-unfold', 's-operation', 's-promotion', 's-home', 's-release', 's-ticket', 's-management', 's-open', 's-shop', 's-marketing', 's-flag', 's-comment', 's-finance', 's-claim', 's-custom', 's-opportunity', 's-data', 's-check', 's-grid', 'menu', 'share', 'd-caret', 'caret-left', 'caret-right', 'caret-bottom', 'caret-top', 'bottom-left', 'bottom-right', 'back', 'right', 'bottom', 'top', 'top-left', 'top-right', 'arrow-left', 'arrow-right', 'arrow-down', 'arrow-up', 'd-arrow-left', 'd-arrow-right', 'video-pause', 'video-play', 'refresh', 'refresh-right', 'refresh-left', 'finished', 'sort', 'sort-up', 'sort-down', 'rank', 'loading', 'view', 'c-scale-to-original', 'date', 'edit', 'edit-outline', 'folder', 'folder-opened', 'folder-add', 'folder-remove', 'folder-delete', 'folder-checked', 'tickets', 'document-remove', 'document-delete', 'document-copy', 'document-checked', 'document', 'document-add', 'printer', 'paperclip', 'takeaway-box', 'search', 'monitor', 'attract', 'mobile', 'scissors', 'umbrella', 'headset', 'brush', 'mouse', 'coordinate', 'magic-stick', 'reading', 'data-line', 'data-board', 'pie-chart', 'data-analysis', 'collection-tag', 'film', 'suitcase', 'suitcase-1', 'receiving', 'collection', 'files', 'notebook-1', 'notebook-2', 'toilet-paper', 'office-building', 'school', 'table-lamp', 'house', 'no-smoking', 'smoking', 'shopping-cart-full', 'shopping-cart-1', 'shopping-cart-2', 'shopping-bag-1', 'shopping-bag-2', 'sold-out', 'sell', 'present', 'box', 'bank-card', 'money', 'coin', 'wallet', 'discount', 'price-tag', 'news', 'guide', 'male', 'female', 'thumb', 'cpu', 'link', 'connection', 'open', 'turn-off', 'set-up', 'chat-round', 'chat-line-round', 'chat-square', 'chat-dot-round', 'chat-dot-square', 'chat-line-square', 'message', 'postcard', 'position', 'turn-off-microphone', 'microphone', 'close-notification', 'bangzhu', 'time', 'odometer', 'crop', 'aim', 'switch-button', 'full-screen', 'copy-document', 'mic', 'stopwatch', 'medal-1', 'medal', 'trophy', 'trophy-1', 'first-aid-kit', 'discover', 'place', 'location', 'location-outline', 'location-information', 'add-location', 'delete-location', 'map-location', 'alarm-clock', 'timer', 'watch-1', 'watch', 'lock', 'unlock', 'key', 'service', 'mobile-phone', 'bicycle', 'truck', 'ship', 'basketball', 'football', 'soccer', 'baseball', 'wind-power', 'light-rain', 'lightning', 'heavy-rain', 'sunrise', 'sunrise-1', 'sunset', 'sunny', 'cloudy', 'partly-cloudy', 'cloudy-and-sunny', 'moon', 'moon-night', 'dish', 'dish-1', 'food', 'chicken', 'fork-spoon', 'knife-fork', 'burger', 'tableware', 'sugar', 'dessert', 'ice-cream', 'hot-water', 'water-cup', 'coffee-cup', 'cold-drink', 'goblet', 'goblet-full', 'goblet-square', 'goblet-square-full', 'refrigerator', 'grape', 'watermelon', 'cherry', 'apple', 'pear', 'orange', 'coffee', 'ice-tea', 'ice-drink', 'milk-tea', 'potato-strips', 'lollipop', 'ice-cream-square', 'ice-cream-round']  
2 -  
3 -export default elementIcons  
1 -<template>  
2 - <div class="icons-container">  
3 - <aside>  
4 - <a href="#" target="_blank">Add and use  
5 - </a>  
6 - </aside>  
7 - <el-tabs type="border-card">  
8 - <el-tab-pane label="Icons">  
9 - <div v-for="item of svgIcons" :key="item">  
10 - <el-tooltip placement="top">  
11 - <div slot="content">  
12 - {{ generateIconCode(item) }}  
13 - </div>  
14 - <div class="icon-item">  
15 - <svg-icon :icon-class="item" class-name="disabled" />  
16 - <span>{{ item }}</span>  
17 - </div>  
18 - </el-tooltip>  
19 - </div>  
20 - </el-tab-pane>  
21 - <el-tab-pane label="Element-UI Icons">  
22 - <div v-for="item of elementIcons" :key="item">  
23 - <el-tooltip placement="top">  
24 - <div slot="content">  
25 - {{ generateElementIconCode(item) }}  
26 - </div>  
27 - <div class="icon-item">  
28 - <i :class="'el-icon-' + item" />  
29 - <span>{{ item }}</span>  
30 - </div>  
31 - </el-tooltip>  
32 - </div>  
33 - </el-tab-pane>  
34 - </el-tabs>  
35 - </div>  
36 -</template>  
37 -  
38 -<script>  
39 -import svgIcons from './svg-icons'  
40 -import elementIcons from './element-icons'  
41 -  
42 -export default {  
43 - name: 'Icons',  
44 - data() {  
45 - return {  
46 - svgIcons,  
47 - elementIcons  
48 - }  
49 - },  
50 - methods: {  
51 - generateIconCode(symbol) {  
52 - return `<svg-icon icon-class="${symbol}" />`  
53 - },  
54 - generateElementIconCode(symbol) {  
55 - return `<i class="el-icon-${symbol}" />`  
56 - }  
57 - }  
58 -}  
59 -</script>  
60 -  
61 -<style lang="scss" scoped>  
62 -.icons-container {  
63 - margin: 10px 20px 0;  
64 - overflow: hidden;  
65 -  
66 - .icon-item {  
67 - margin: 20px;  
68 - height: 85px;  
69 - text-align: center;  
70 - width: 100px;  
71 - float: left;  
72 - font-size: 30px;  
73 - color: #24292e;  
74 - cursor: pointer;  
75 - }  
76 -  
77 - span {  
78 - display: block;  
79 - font-size: 16px;  
80 - margin-top: 10px;  
81 - }  
82 -  
83 - .disabled {  
84 - pointer-events: none;  
85 - }  
86 -}  
87 -</style>  
1 -const req = require.context('../../../assets/icons/svg', false, /\.svg$/)  
2 -const requireAll = requireContext => requireContext.keys()  
3 -  
4 -const re = /\.\/(.*)\.svg/  
5 -  
6 -const svgIcons = requireAll(req).map(i => {  
7 - return i.match(re)[1]  
8 -})  
9 -  
10 -export default svgIcons