lightlimx-website/plugins/svgIcon.js

10 lines
316 B
JavaScript
Raw Permalink Normal View History

2024-07-10 14:57:22 +08:00
// plugins/svgIcon.js
import Vue from 'vue'
import SvgIcon from '@/components/SvgIcon.vue'// Nuxt 默认@指向根目录
// 注册组件
Vue.component('svg-icon', SvgIcon)
// 预请求svg组件(通过之前的svg-sprite-loader加载)
const req = require.context('@/assets/svg', false, /\.svg$/)
req.keys().map(req)