Skip to content

Commit

Permalink
fix: 修复Waterfall列数错误BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
kailong321200875 committed Oct 14, 2023
1 parent d2dd384 commit 1c2befa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Table/src/Table.vue
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/components/Waterfall/src/Waterfall.vue
Expand Up @@ -42,6 +42,7 @@ const cols = ref(0)
const filterData = ref<any[]>([])
const filterWaterfall = async () => {
filterData.value = []
const { props, width, gap } = prop
const data = prop.data as any[]
await nextTick()
Expand All @@ -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
Expand Down

0 comments on commit 1c2befa

Please sign in to comment.