Commit 7db21cad authored by 何虹's avatar 何虹 💬

兼容

parent 6c9a4f36
import Vue from 'vue' import Vue from 'vue'
const requireComponent_ = require.context('./', true, /index.vue$/) const requireComponent_ = require.context('./', true, /index.vue$/)
const obj={}
requireComponent_.keys().forEach(fileName => { requireComponent_.keys().forEach(fileName => {
const componentConfig = requireComponent_(fileName) const componentConfig = requireComponent_(fileName)
const { name } = componentConfig.default const { name } = componentConfig.default
if (name) { if (name) {
Vue.component(name, componentConfig.default || componentConfig) Vue.component(name, componentConfig.default || componentConfig)
obj[name]=componentConfig.default
} }
}) })
export default { export default obj
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment