第117期 — 2021-07-25

在浏览器中阅读

周e信

扫描二维码关注微信公众号

Javascript

Nicolas Carlo

Microsoft Edge Team

then(f,f) vs then(f).catch(f)🔗

作者估计被绕进去了,实际应用没这么复杂,如果需要链式写法,使用.catch

Dmitri Pavlutin

ajit

前端

Unmesh Gundecha

Andrew Wilshere

图片延迟加载过多的性能影响🔗

如果图片是页面上的第一张特色图片或主要内容中的第一张图片,则假定它位于折叠区(fold)上方(或靠近折叠处),则不应延迟加载。

Rick Viscomi, Felix Arntz

Antoni Silvestrovič

react-wavify - 波形特效组件🔗

如果图片是页面上的第一张特色图片或主要内容中的第一张图片,则假定它位于折叠区(fold)上方(或靠近折叠处),则不应延迟加载。

Jaxson Van Doorn

Wondermarin

react-tags - 可拖拽tag组件🔗

当您更改配色方案时,应用程序图标不会动态更新。相反,无论您在安装时将系统设置为什么,它们都会保持初始的暗模式或亮模式外观。

React Tags

Akash

udecode

nativefier

Dark模式 Web 应用程序图标🔗

解决方案

// First we get the viewport height and we multiple it by 1% to get a value for a vh unit
let vh = window.innerHeight * 0.01;
// Then we set the value in the --vh custom property to the root of the document
document.documentElement.style.setProperty('--vh', `${vh}px`);

Thomas Steiner

Jason Grigsby

扫描二维码关注微信公众号