From 4f86a916f83c7751e218a5dd92f264ef1bfbc25f Mon Sep 17 00:00:00 2001 From: gimmyhehe <975402925@qq.com> Date: Thu, 5 Sep 2024 16:54:16 +0800 Subject: [PATCH] fix(grid): [grid] fix empty slot error when is-center-empty is set (#2051) --- packages/vue/src/grid/package.json | 2 +- packages/vue/src/grid/src/table/src/table.ts | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/vue/src/grid/package.json b/packages/vue/src/grid/package.json index 2001e96470..0c68e3655a 100644 --- a/packages/vue/src/grid/package.json +++ b/packages/vue/src/grid/package.json @@ -1,7 +1,7 @@ { "name": "@opentiny/vue-grid", "type": "module", - "version": "3.18.1", + "version": "3.18.2", "description": "", "license": "MIT", "sideEffects": false, diff --git a/packages/vue/src/grid/src/table/src/table.ts b/packages/vue/src/grid/src/table/src/table.ts index e6379d34a1..922a89e9f1 100644 --- a/packages/vue/src/grid/src/table/src/table.ts +++ b/packages/vue/src/grid/src/table/src/table.ts @@ -103,7 +103,9 @@ function mergeTreeConfig(_vm) { } const renderEmptyPartFn = (opt) => { - const { _vm, tableData, $slots, renderEmpty } = opt + const { _vm, tableData } = opt + const { $grid = {}, renderEmpty } = _vm + const { $slots } = $grid return () => { let emptyPartVnode = null let { computerTableBodyHeight } = _vm @@ -272,21 +274,13 @@ function getRenderer(opt) { visibleColumn } = opt const { $grid, ctxMenuStore, editRules, filterStore, footerData, footerMethod, hasFilter, hasTip, height, id } = _vm - const { - isCtxMenu, - isResizable, - renderEmpty, - scrollbarHeight, - selectToolbarStore, - tooltipContentOpts, - vaildTipOpts, - validOpts - } = _vm + const { isCtxMenu, isResizable, scrollbarHeight, selectToolbarStore, tooltipContentOpts, vaildTipOpts, validOpts } = + _vm const { selectToolbar, renderedToolbar } = $grid const renderHeader = () => showHeader ? h(GridHeader, { ref: 'tableHeader', props, class: _vm.viewCls('tableHeader') }) : [null] - const renderEmptyPart = renderEmptyPartFn({ _vm, tableData, $slots, renderEmpty }) + const renderEmptyPart = renderEmptyPartFn({ _vm, tableData }) const renderFooter = renderFooterFn({ _vm, showFooter, footerData, footerMethod, tableColumn, visibleColumn, vSize }) const renderResizeBar = renderResizeBarFn({ _vm, isResizable, overflowX, scrollbarHeight }) const arg1 = { hasFilter, optimizeOpts, filterStore, isCtxMenu, ctxMenuStore, hasTip, tooltipContentOpts }