// 自动化引入模块组件
const path = require('path')
const files = require.context('@/components/common/modules', false, /\.vue$/)
const modules = {}
files.keys().forEach(key => {
const name = path.basename(key, '.vue')
modules[name] = files(key).default || files(key)
})
// console.log('modules',modules)
// 获取组件的名称
const modules_name = []
for (let key of Object.keys(modules)) {
let name = key.split('common')[1]
modules_name.push(+name)
}
// console.log('modules_name',modules_name)
export default {
components: {...modules},
}