Skip to content

Commit

Permalink
ci: add install func
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Apr 15, 2021
1 parent f99b87e commit 7d76409
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/component/pro-form/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,16 @@ ProForm.install = function (Vue, options) {
}
Vue.component('ProForm', ProForm);
};
// 定义 install 方法
const install: any = (Vue, options = {}) => {
if (install.installed) return;
install.installed = true;
// 遍历并注册全局组件
Vue.prototype.$PROCRUD = options;
Vue.component('ProForm', ProForm);
};

if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue);
}
export default ProForm;
13 changes: 13 additions & 0 deletions src/component/pro-table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,17 @@ ProTable.install = function (Vue, options) {
Vue.component(ProTable.name, ProTable);
};

// 定义 install 方法
const install: any = (Vue, options = {}) => {
if (install.installed) return;
install.installed = true;
// 遍历并注册全局组件
Vue.prototype.$PROCRUD = options;
Vue.component(ProTable.name, ProTable);
};

if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue);
}

export default ProTable;

0 comments on commit 7d76409

Please sign in to comment.