Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信小程序中骨架屏怎么用?骨架屏有什么好处? #23

Open
jynba opened this issue Sep 26, 2023 · 0 comments
Open

微信小程序中骨架屏怎么用?骨架屏有什么好处? #23

jynba opened this issue Sep 26, 2023 · 0 comments

Comments

@jynba
Copy link
Owner

jynba commented Sep 26, 2023

什么是骨架屏?

  • 骨架屏是一种在页面加载内容之前,以占位符或虚拟元素形式展示的页面加载动画或效果。其主要目的是为了提供更好的用户体验,让用户在等待页面内容加载时不至于感到空白和焦虑。

注意:骨架屏并不能缩短首屏时间,相反还会增加首屏时间,但是会给用户反馈,体验更好

首屏时间和白屏时间有什么区别?

白屏时间是用户在页面加载过程中看到空白屏幕的时间,而首屏时间是用户在页面加载过程中看到重要内容的时间。
首屏时间是白屏时间的子集。它不仅包括白屏时间,还包括页面的一部分内容开始呈现在屏幕上的时间。

微信小程序一键生成骨架屏

在微信小程序中可以方便地为页面添加骨架屏

  • 直接在页面下方有一个生成骨架屏的按钮
    image
  • 生成配置文件,按生成的文件导入wxss、wxml,js中的loading:true,onReady中设置加载状态为false
  • 至此即可完成骨架屏加载
    官方视频
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant