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

测试

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