diff --git a/index.ts b/index.ts index 1276991..a0f1ef5 100644 --- a/index.ts +++ b/index.ts @@ -42,6 +42,7 @@ function getFooterData (opts: VxeTablePropTypes.ExportConfig, footerData: any[][ } function exportPDF (params: VxeGlobalInterceptorHandles.InterceptorExportParams) { + const { modal, t } = vxetable const { fonts, beforeMethod } = globalOptions const { $table, options, columns, datas } = params const { props } = $table @@ -123,13 +124,13 @@ function exportPDF (params: VxeGlobalInterceptorHandles.InterceptorExportParams) }) // 导出 pdf doc.save(`${filename}.${type}`) - if (showMsg) { - vxetable.modal.close(msgKey) - vxetable.modal.message({ message: vxetable.t('vxe.table.expSuccess'), status: 'success' }) + if (showMsg && modal) { + modal.close(msgKey) + modal.message({ content: t('vxe.table.expSuccess'), status: 'success' }) } } - if (showMsg) { - vxetable.modal.message({ id: msgKey, message: vxetable.t('vxe.table.expLoading'), status: 'loading', duration: -1 }) + if (showMsg && modal) { + modal.message({ id: msgKey, content: t('vxe.table.expLoading'), status: 'loading', duration: -1 }) } checkFont(fontConf).then(() => { if (showMsg) { diff --git a/package.json b/package.json index ea2f72b..1fcd049 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vxe-table-plugin-export-pdf", - "version": "3.0.1", + "version": "3.0.2", "description": "基于 vxe-table 的表格插件,支持导出 pdf 格式", "scripts": { "lib": "gulp build" @@ -51,11 +51,11 @@ "prettier": "^2.1.2", "typescript": "^4.0.5", "vue": "^3.0.6", - "vxe-table": "^4.0.5", - "xe-utils": "^3.1.11" + "vxe-table": "^4.0.10", + "xe-utils": "^3.1.13" }, "peerDependencies": { - "vxe-table": "^4.0.0" + "vxe-table": "^4.0.10" }, "repository": { "type": "git",