[Feature Request] 使用非常方便的骨架屏解决方案 #9313
98kWarning
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
这个功能解决了什么问题
解决现有骨架屏使用麻烦,适用度低的问题
描述您想要的解决方案
使用时将需要显示的视图通过slot放入骨架屏组件内,然后给视图内的span、a、img等标签设置带动画的背景和透明字体色来让实现骨架屏效果,在通过props来控制是否显示骨架屏。对于某些也要有骨架效果的div标签,用v-slot="{ vClass }"回传一个vClass,把vClass设置给div,实现对div的单独控制
建议的API是什么样的
通过传一个props来控制是否显示骨架屏状态
效果
使用
我自己简单实现的代码
Beta Was this translation helpful? Give feedback.
All reactions