From 1525362c4eb5264a08878862f8a23395455cb61e Mon Sep 17 00:00:00 2001 From: BoBoooooo <17746714@qq.com> Date: Wed, 23 Dec 2020 10:04:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Delement-pro-crud?= =?UTF-8?q?=E5=A4=96=E7=BD=91cdn=E5=BC=95=E5=85=A5=E6=97=B6=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96options=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/element-pro-crud.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/element-pro-crud.ts b/src/plugins/element-pro-crud.ts index 286dbad..8764014 100644 --- a/src/plugins/element-pro-crud.ts +++ b/src/plugins/element-pro-crud.ts @@ -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); +}