Skip to content

Commit 3ccc2d1

Browse files
feat: update demo section visibility and enhance waterfall item transition effects
1 parent 60e831d commit 3ccc2d1

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/App.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293
</div>
294294
</section>
295295

296-
<section class="demo-section" v-if="false">
296+
<section class="demo-section" v-if="true">
297297
<h2>瀑布流演示</h2>
298298

299299
<div class="demo-group">
@@ -732,9 +732,6 @@ onBeforeUnmount(() => {
732732
border-radius: 8px;
733733
overflow: hidden;
734734
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
735-
transition:
736-
transform 0.3s,
737-
box-shadow 0.3s;
738735
cursor: pointer;
739736
}
740737

src/components/list/waterfall/tml-waterfall.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function ensureStyles(el: HTMLElement, width: number): void {
114114
function buildItems(): void {
115115
if (!containerRef.value) return
116116
itemsOrder.value = Array.from(containerRef.value.children) as HTMLElement[]
117-
itemsOrder.value.forEach((el) => (el.style.transition = 'transform 0.2s ease'))
117+
itemsOrder.value.forEach((el) => {el.style.opacity = el.style.opacity || '0'})
118118
}
119119
120120
/**
@@ -169,6 +169,8 @@ function doLayout(start: number): void {
169169
el.style.transform = `translate(${left}px, ${top}px)`
170170
itemMeta.set(el, { col: targetCol, top, height: h })
171171
cols[targetCol] = top + h + props.gap
172+
el.style.transition = 'opacity 0.4s ease'
173+
el.style.opacity = '1'
172174
}
173175
174176
// 设置容器高度

0 commit comments

Comments
 (0)