Skip to content

Commit df8c87d

Browse files
authored
fix: rows/cols가 비어있을 때 Vue2와 동일하게 렌더링되도록 수정 (#254)
* fix: 베타 버전 증가 로직 수정 changeset version이 베타 접미사가 있는 버전을 증가시키지 않는 문제 해결: 1. changeset version 실행 전에 베타 접미사 임시 제거 2. changeset version으로 버전 증가 (1.1.6 → 1.1.7) 3. 증가된 버전에 베타 접미사 재적용 (1.1.7-beta.timestamp) 이제 베타 상태에서도 올바른 버전 증가가 가능함 * fix: rows/cols가 비어있을 때 Vue2와 동일하게 렌더링되도록 수정 - 디버그용 console.log 코드 제거 - rows/cols가 모두 비어있을 때도 테이블 구조와 총계가 표시되도록 수정 - rowAttrs가 비어있을 때 헤더에 빈 행이 추가되는 문제 해결 - Vue2의 렌더링 동작과 완전히 일치하도록 조건부 렌더링 로직 개선
1 parent 6562c65 commit df8c87d

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"vue-pivottable": patch
3+
---
4+
5+
fix: rows/cols가 비어있을 때 Vue2와 동일하게 렌더링되도록 수정
6+
7+
- 디버그용 console.log 코드 제거
8+
- rows/cols가 모두 비어있을 때도 테이블 구조와 총계가 표시되도록 수정
9+
- rowAttrs가 비어있을 때 헤더에 빈 행이 추가되는 문제 해결
10+
- Vue2의 렌더링 동작과 완전히 일치하도록 조건부 렌더링 로직 개선

src/components/pivottable-ui/VDragAndDropCell.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<Draggable
3-
v-if="showDraggable && modelItems.length > 0"
3+
v-if="showDraggable"
44
tag="td"
55
:list="modelItems"
66
:group="{ name: 'shared', pull: true, put: true }"

src/components/pivottable/VPivottableBody.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
2-
<tbody v-if="pivotData">
2+
<tbody>
33
<VPivottableBodyRows
4+
v-if="rowKeys.length > 0"
45
:row-keys="rowKeys"
56
:col-keys="colKeys"
67
:show-row-total="showRowTotal"
@@ -31,6 +32,5 @@ type Props = Pick<
3132
3233
defineProps<Props>()
3334
34-
const { pivotData, rowKeys, colKeys, rowAttrs, colAttrs } =
35-
useProvidePivotData()
35+
const { rowKeys, colKeys, rowAttrs, colAttrs } = useProvidePivotData()
3636
</script>

src/components/pivottable/VPivottableBodyRows.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ type VPivottableBodyRowsProps = Pick<
6161
}
6262
6363
const props = defineProps<VPivottableBodyRowsProps>()
64-
6564
const {
6665
pivotData,
6766
spanSize,

src/components/pivottable/VPivottableBodyRowsTotalRow.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<tr v-if="showColTotal">
2+
<tr v-if="showColTotal || (colKeys.length === 0 && rowKeys.length === 0)">
33
<th
44
class="pvtTotalLabel"
55
:colSpan="rowAttrs.length + (colAttrs.length === 0 ? 0 : 1)"
@@ -18,7 +18,7 @@
1818
{{ getAggregator([], colKey).format(getAggregator([], colKey).value()) }}
1919
</td>
2020
<td
21-
v-if="showRowTotal"
21+
v-if="showRowTotal || (colKeys.length === 0 && rowKeys.length === 0)"
2222
class="pvtGrandTotal"
2323
@click="handleCellClick(grandTotalValue, [], [])($event)"
2424
>
@@ -45,6 +45,7 @@ const {
4545
colAttrs,
4646
rowAttrs,
4747
colKeys,
48+
rowKeys,
4849
pivotData
4950
} = useProvidePivotData()
5051

src/components/pivottable/VPivottableHeader.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<thead v-if="pivotData">
2+
<thead>
33
<tr
44
v-for="(c, j) in colAttrs"
55
:key="`colAttrs${j}`"
@@ -46,5 +46,5 @@ type Props = Pick<DefaultPropsType, 'showRowTotal' | 'languagePack'>
4646
4747
defineProps<Props>()
4848
49-
const { pivotData, colAttrs, rowAttrs, colKeys } = useProvidePivotData()
49+
const { colAttrs, rowAttrs, colKeys } = useProvidePivotData()
5050
</script>

0 commit comments

Comments
 (0)