1
0
mirror of synced 2025-12-07 22:28:34 +08:00

releases 4.7.27

This commit is contained in:
xuliangzhan
2024-06-20 12:35:42 +08:00
parent 4b2b5fd88e
commit f02e18fc12
2 changed files with 11 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "vxe-table",
"version": "4.7.26",
"version": "4.7.27",
"description": "一个基于 vue 的 PC 端表格组件支持增删改查、虚拟树、列拖拽懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
"scripts": {
"update": "npm install --legacy-peer-deps",

View File

@@ -1242,22 +1242,29 @@ hooks.add('tableExportModule', {
opts.sheetName = document.title
}
const beforePrintMethod = opts.beforePrintMethod
const tableHtml = opts.html || opts.content
return new Promise((resolve, reject) => {
if (VxeUI.print) {
if (opts.content) {
if (tableHtml) {
resolve(
VxeUI.print({
title: opts.sheetName,
html: opts.content
html: tableHtml,
customStyle: opts.style,
beforeMethod: beforePrintMethod
? ({ html }) => {
return beforePrintMethod({ html, content: html, options: opts, $table: $xeTable })
}
: undefined
})
)
} else {
resolve(
exportMethods.exportData(opts).then(({ content }: any) => {
debugger
return VxeUI.print({
title: opts.sheetName,
html: content,
customStyle: opts.style,
beforeMethod: beforePrintMethod
? ({ html }) => {
return beforePrintMethod({ html, content: html, options: opts, $table: $xeTable })