feat: 新增 ui-skeleton 骨架屏组件 (card / list-row / circle)

This commit is contained in:
2026-07-08 11:35:16 +08:00
parent 0bba403b00
commit 677a3ff64b
4 changed files with 138 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
Component({
properties: {
variant: { type: String, value: 'card' },
count: { type: Number, value: 1 },
active: { type: Boolean, value: true }
},
data: {
_minDisplayShown: false
},
lifetimes: {
attached() {
// 200ms 最小显示,避免骨架闪一下
this._minTimer = setTimeout(() => {
this.setData({ _minDisplayShown: true })
}, 200)
},
detached() {
if (this._minTimer) clearTimeout(this._minTimer)
}
}
})