Skip to content

Commit b2a91c8

Browse files
committed
optimize
1 parent ca43110 commit b2a91c8

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ function getFooterData (opts: VxeTablePropTypes.ExportConfig, footerData: any[][
4242
}
4343

4444
function exportPDF (params: VxeGlobalInterceptorHandles.InterceptorExportParams) {
45+
const { modal, t } = vxetable
4546
const { fonts, beforeMethod } = globalOptions
4647
const { $table, options, columns, datas } = params
4748
const { props } = $table
@@ -123,13 +124,13 @@ function exportPDF (params: VxeGlobalInterceptorHandles.InterceptorExportParams)
123124
})
124125
// 导出 pdf
125126
doc.save(`${filename}.${type}`)
126-
if (showMsg) {
127-
vxetable.modal.close(msgKey)
128-
vxetable.modal.message({ message: vxetable.t('vxe.table.expSuccess'), status: 'success' })
127+
if (showMsg && modal) {
128+
modal.close(msgKey)
129+
modal.message({ content: t('vxe.table.expSuccess'), status: 'success' })
129130
}
130131
}
131-
if (showMsg) {
132-
vxetable.modal.message({ id: msgKey, message: vxetable.t('vxe.table.expLoading'), status: 'loading', duration: -1 })
132+
if (showMsg && modal) {
133+
modal.message({ id: msgKey, content: t('vxe.table.expLoading'), status: 'loading', duration: -1 })
133134
}
134135
checkFont(fontConf).then(() => {
135136
if (showMsg) {

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vxe-table-plugin-export-pdf",
3-
"version": "3.0.1",
3+
"version": "3.0.2",
44
"description": "基于 vxe-table 的表格插件,支持导出 pdf 格式",
55
"scripts": {
66
"lib": "gulp build"
@@ -51,11 +51,11 @@
5151
"prettier": "^2.1.2",
5252
"typescript": "^4.0.5",
5353
"vue": "^3.0.6",
54-
"vxe-table": "^4.0.5",
55-
"xe-utils": "^3.1.11"
54+
"vxe-table": "^4.0.10",
55+
"xe-utils": "^3.1.13"
5656
},
5757
"peerDependencies": {
58-
"vxe-table": "^4.0.0"
58+
"vxe-table": "^4.0.10"
5959
},
6060
"repository": {
6161
"type": "git",

0 commit comments

Comments
 (0)