diff --git a/src/icons/index.js b/src/icons/index.js index d850a9c3..c8e36b9b 100644 --- a/src/icons/index.js +++ b/src/icons/index.js @@ -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 diff --git a/src/views/svg-icons/index.vue b/src/views/svg-icons/index.vue index e0233f98..8cf289ef 100644 --- a/src/views/svg-icons/index.vue +++ b/src/views/svg-icons/index.vue @@ -2,7 +2,12 @@
- + +
+ {{`<icon-svg :icon-class="${item}" />`}} +
+ +
{{item}}
@@ -42,6 +47,7 @@ export default { float: left; font-size: 40px; color: #666; + cursor: pointer; } span { display: block;