Skip to content

Commit

Permalink
fix: 修复element-pro-crud外网cdn引入时初始化options bug
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Dec 23, 2020
1 parent 425cfcd commit 1525362
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/plugins/element-pro-crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ import ElementProCrud from 'element-pro-crud';
import { crud } from '@/api/public/crud';
import * as pluginsApi from '@/api/system/form';

Vue.use(ElementProCrud, {
const $PROCRUD_OPTION = {
...pluginsApi,
crud,
});
};
// 通过cdn挂载插件时无法传入指定options,直接挂在原型链
if (process.env.VUE_APP_CDN === 'true') {
Vue.prototype.$PROCRUD = $PROCRUD_OPTION;
} else {
Vue.use(ElementProCrud, $PROCRUD_OPTION);
}

0 comments on commit 1525362

Please sign in to comment.