From 1c2befa4ddc76c625774100e3f5dd5a68a6faa45 Mon Sep 17 00:00:00 2001 From: kailong321200875 <321200875@qq.com> Date: Sat, 14 Oct 2023 08:19:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DWaterfall=E5=88=97?= =?UTF-8?q?=E6=95=B0=E9=94=99=E8=AF=AFBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/src/Table.vue | 2 +- src/components/Waterfall/src/Waterfall.vue | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Table/src/Table.vue b/src/components/Table/src/Table.vue index 5147904..adad3b6 100644 --- a/src/components/Table/src/Table.vue +++ b/src/components/Table/src/Table.vue @@ -228,7 +228,7 @@ export default defineComponent({ const addColumn = (column: TableColumn, index?: number) => { const { columns } = unref(getProps) - if (index || index === 0) { + if (index !== void 0) { columns.splice(index, 0, column) } else { columns.push(column) diff --git a/src/components/Waterfall/src/Waterfall.vue b/src/components/Waterfall/src/Waterfall.vue index bf3018d..ae648c1 100644 --- a/src/components/Waterfall/src/Waterfall.vue +++ b/src/components/Waterfall/src/Waterfall.vue @@ -42,6 +42,7 @@ const cols = ref(0) const filterData = ref([]) const filterWaterfall = async () => { + filterData.value = [] const { props, width, gap } = prop const data = prop.data as any[] await nextTick() @@ -65,7 +66,7 @@ const filterWaterfall = async () => { let minHeight = heights.value[0] let index = 0 // 找出最小高度 - for (let j = 1; j < cols.value; j++) { + for (let j = 1; j < unref(cols); j++) { if (unref(heights)[j] < minHeight) { minHeight = unref(heights)[j] index = j