2021-12-14 18:36:19 +08:00
|
|
|
|
//引入当前工程所有的应用
|
|
|
|
|
|
const install = function(Vue) {
|
|
|
|
|
|
if (install.installed) return Promise.resolve();
|
|
|
|
|
|
else {
|
2022-02-28 18:09:21 +08:00
|
|
|
|
let contexts = require.context('../project/xiushan', true, /(\/.+)\/App[^\/]+\.vue$/);
|
2021-12-14 18:36:19 +08:00
|
|
|
|
if (contexts) {
|
|
|
|
|
|
contexts.keys().map((e) => {
|
|
|
|
|
|
if (contexts(e).default) {
|
|
|
|
|
|
Vue.component(contexts(e).default.name, contexts(e).default);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
// 判断是否是直接引入文件
|
|
|
|
|
|
if (typeof window !== 'undefined' && window.Vue) {
|
|
|
|
|
|
install(window.Vue);
|
|
|
|
|
|
}
|
|
|
|
|
|
export default {
|
|
|
|
|
|
// 导出的对象必须具有 install,才能被 Vue.use() 方法安装
|
|
|
|
|
|
install
|
|
|
|
|
|
};
|