{ const name = path.dirname(key).slice(2) that.$options.components[name] = require('../module/' _vue3 r">
赞
踩
const path = require("path")
const files = require.context("../module", true, /\index.vue$/)
files.keys().forEach(key => {
const name = path.dirname(key).slice(2)
that.$options.components[name] = require('../module/' + name).default
})
vue3继续使用上面方法会报错 具体细节未深究 解决方案:
import.meta.globEager("../../assets/authentication/*.png")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。