vue 一次引入组件

const path = require('path')
const file=require.context('./components',false,/\.vue/)
let modules={}
file.keys().forEach(key => {
  const name = path.basename(key, '.vue')
  modules[name]=file(key).default || file(key)
});