Skip to content

Commit

Permalink
releases 4.10.10
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Feb 10, 2025
1 parent a4275a7 commit cc6653d
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vxe-table",
"version": "4.10.9",
"version": "4.10.10",
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、拖拽排序,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down
50 changes: 44 additions & 6 deletions packages/table/src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,13 @@ export default defineComponent({
isFooter: false
},

rowHeightStore: {
default: 48,
medium: 44,
small: 40,
mini: 36
},

scrollVMLoading: false,

calcCellHeightFlag: 1,
Expand Down Expand Up @@ -357,6 +364,7 @@ export default defineComponent({
let tablePrivateMethods = {} as TablePrivateMethods

const refElem = ref() as Ref<HTMLDivElement>
const refVarElem = ref() as Ref<HTMLDivElement>
const refTooltip = ref() as Ref<VxeTooltipInstance>
const refCommTooltip = ref() as Ref<VxeTooltipInstance>
const refValidTooltip = ref() as Ref<VxeTooltipInstance>
Expand Down Expand Up @@ -473,12 +481,7 @@ export default defineComponent({
})

const computeRowHeightMaps = computed(() => {
return {
default: 48,
medium: 44,
small: 40,
mini: 36
}
return reactData.rowHeightStore
})

const computeDefaultRowHeight = computed(() => {
Expand Down Expand Up @@ -9447,6 +9450,23 @@ export default defineComponent({
h('div', {
class: 'vxe-table-slots'
}, slots.default ? slots.default({}) : []),
h('div', {
ref: refVarElem,
class: 'vxe-table-vars'
}, [
h('div', {
class: 'vxe-table-var-default'
}),
h('div', {
class: 'vxe-table-var-medium'
}),
h('div', {
class: 'vxe-table-var-small'
}),
h('div', {
class: 'vxe-table-var-mini'
})
]),
h('div', {
key: 'tw',
class: 'vxe-table--render-wrapper'
Expand Down Expand Up @@ -9810,10 +9830,28 @@ export default defineComponent({
})

onMounted(() => {
const { rowHeightStore } = reactData
const varEl = refVarElem.value
const columnOpts = computeColumnOpts.value
const rowOpts = computeRowOpts.value
const customOpts = computeCustomOpts.value

if (varEl) {
const [defEl, mediumEl, smallEl, miniEl] = varEl.children
if (defEl) {
rowHeightStore.default = defEl.clientHeight
}
if (mediumEl) {
rowHeightStore.medium = mediumEl.clientHeight
}
if (smallEl) {
rowHeightStore.small = smallEl.clientHeight
}
if (miniEl) {
rowHeightStore.mini = miniEl.clientHeight
}
}

if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
initTpImg()
}
Expand Down
21 changes: 21 additions & 0 deletions styles/components/table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@
display: none;
}

.vxe-table-vars {
height: 0;
width: 0;
visibility: hidden;
overflow: hidden;
user-select: none;
pointer-events: none;
.vxe-table-var-default {
height: var(--vxe-ui-table-row-height-default);
}
.vxe-table-var-medium {
height: var(--vxe-ui-table-row-height-medium);
}
.vxe-table-var-small {
height: var(--vxe-ui-table-row-height-small);
}
.vxe-table-var-mini {
height: var(--vxe-ui-table-row-height-mini);
}
}

.vxe-table--print-frame {
position: fixed;
bottom: -100%;
Expand Down

0 comments on commit cc6653d

Please sign in to comment.