追加关于党组织的抽象类
This commit is contained in:
@@ -5,6 +5,15 @@ let components = [];
|
||||
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
|
||||
const install = function (Vue) {
|
||||
if (install.installed) return;
|
||||
// 声明全局业务对象类
|
||||
const models = require.context('./model', true, /\.js$/)
|
||||
if (models) {
|
||||
const model = {}
|
||||
models.keys().map(e => {
|
||||
model[e.replace(/\.[\/\\]([^\\\/]+)\.js$/, '$1')] = models(e).default
|
||||
})
|
||||
Vue.prototype.MODEL = model
|
||||
}
|
||||
// 遍历注册全局组件
|
||||
let contexts = require.context('.', true, /[\\\/]Ai([^\\\/]+)\.vue$/);
|
||||
if (contexts) {
|
||||
|
||||
Reference in New Issue
Block a user