Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Apr 12, 2021
1 parent ca43110 commit b2a91c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit b2a91c8

Please sign in to comment.