初始化

This commit is contained in:
robin
2022-07-07 22:24:46 +08:00
commit 72b69615b6
42 changed files with 10068 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import Vue from 'vue'
import App from './App.vue'
const files = require.context('./plugin', true, /index\.js$/); //批量读取模块文件
const pluginMain = {}
const plugin = files.keys().reduce((modules, path) => {
const name = path.replace(/^\.\/(.*)\.js$/, '$1');
const module = files(path);
// console.log(module);
modules[name] = module.default && module.default(Vue) || null;
if (modules[name]) {
pluginMain[modules[name].name] = modules[name].value
}
return modules;
}, {});
Vue.config.productionTip = false
// console.log('pluginMain',pluginMain);
new Vue({
render: h => h(App),
// components: { App },
...pluginMain,
}).$mount('#app')