feat: 新增 ui-skeleton 骨架屏组件 (card / list-row / circle)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user