diff --git a/index.ts b/index.ts index f6d44b3..3656323 100644 --- a/index.ts +++ b/index.ts @@ -192,9 +192,17 @@ declare module 'vxe-table/lib/vxe-table' { export const VXETablePluginExportPDF = { setup, install (vxetable: typeof VXETable, options?: VXETablePluginExportPDFOptions) { - const { interceptor } = vxetable - vxetable.types.pdf = 0 - interceptor.mixin({ + if (vxetable.types) { + vxetable.types.pdf = 0 + } + vxetable.setup({ + export: { + types: { + pdf: 1 + } + } + }) + vxetable.interceptor.mixin({ 'event.export': handleExportEvent }) if (options) { diff --git a/package.json b/package.json index 332061d..ec5937f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vxe-table-plugin-export-pdf", - "version": "1.8.7", + "version": "1.8.8", "description": "基于 vxe-table 表格的增强插件,支持导出 pdf 格式", "scripts": { "lib": "gulp build"