-
Notifications
You must be signed in to change notification settings - Fork 81
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
MIP 组件可见性优化 #289
Comments
bug场景重现:当被隐藏的标签 Tab 组件中有很多mip-img组件时(隐藏状态),页面第一次加载会请求所有的图片,导致http请求数过多,不利于性能优化,可以修复这个bug吗? |
修复方案:修改可见性状态需要判断元素的 但这将导致目前很多组件在默认下隐藏元素,在操作(如点击切换、延迟显示等)页面时,没有触发
|
召唤大神们来讨论,@VenyXiong |
听起来需要沙盒,MIP有沙盒么?如果托管了所有 API 我们是知道更新时机的。 |
来看看有进展吗 😄 |
+1 看进展。 我们这边用 mip-img 也会偶然出现图片未加载的情况。顺便问下,MIP 规范禁止使用 |
MIP 整个的组件遵循可见加载原则,当元素在屏幕可见范围内时才会触发元素的
firstInviewCallback
回调,但目前 MIP 组件元素被隐藏或者祖先元素被隐藏时,代码逻辑判断有误导致认为该元素是可见状态,从而直接加载了元素,导致资源浪费。mip/src/dom/rect.js
Lines 165 to 174 in fc2e20a
常见的场景有:
示例链接:https://m.idongde.com/18d6bf8565b1Aeb2.shtml
The text was updated successfully, but these errors were encountered: