From f650aa82a60a83e7cac00789894f3df2fbd5b5e6 Mon Sep 17 00:00:00 2001 From: xuliangzhan Date: Fri, 25 Sep 2020 11:43:29 +0800 Subject: [PATCH] update --- index.ts | 14 +++++++++++--- package.json | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) 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"