Commit d19a21ae authored by 何虹's avatar 何虹 💬

测试

parent 22cbc466
...@@ -3,9 +3,10 @@ window.Vue=Vue ...@@ -3,9 +3,10 @@ window.Vue=Vue
import App from './App.vue' import App from './App.vue'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' import 'element-ui/lib/theme-chalk/index.css'
import './packages/index' import tt from './packages/index'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(tt)
new Vue({ new Vue({
render: h => h(App) render: h => h(App)
}).$mount('#app') }).$mount('#app')
import Vue from 'vue' import Vue from 'vue'
const requireComponent_ = require.context('./', true, /index.vue$/) const requireComponent_ = require.context('./', true, /index.vue$/)
const obj={} const obj = {}
requireComponent_.keys().forEach(fileName => { const install = function (Vue) {
const componentConfig = requireComponent_(fileName) if (install.installed) return;
const { name } = componentConfig.default requireComponent_.keys().forEach(fileName => {
if (name) { const componentConfig = requireComponent_(fileName)
Vue.component(name, componentConfig.default || componentConfig) const { name } = componentConfig.default
obj[name]=componentConfig if (name) {
} Vue.component(name, componentConfig.default || componentConfig)
}) obj[name] = componentConfig
}
})
};
// if (typeof window !== 'undefined' && window.Vue || Vue) {
// install(window.Vue || Vue);
// }
// requireComponent_.keys().forEach(fileName => {
// const componentConfig = requireComponent_(fileName)
// const { name } = componentConfig.default
// if (name) {
// Vue.component(name, componentConfig.default || componentConfig)
// obj[name] = componentConfig
// }
// })
obj.install = install
export default obj export default obj
\ No newline at end of file
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