提交 b0b1b9c0 编写于 作者: D DCloud_LXH

chore: docs

上级 29371f4a
......@@ -5,13 +5,13 @@ module.exports = function (md, opts) {
blockToken.children.forEach(function (token) {
const type = token.type;
if (type === 'image') {
const src = token.attrs.find(attr => attr[0] === 'src');
const src = token.attrGet('src')
if (
!token.attrGet('loading') &&
src &&
src[1].indexOf('qiniu-web-assets.dcloud.net.cn') > -1 &&
token.attrs.map(attr => attr[0]).indexOf('loading') < 0
src.indexOf('qiniu-web-assets.dcloud.net.cn') > -1
) {
token.attrs.push(['loading', 'lazy']);
token.attrPush(['loading', 'lazy'])
}
}
});
......
......@@ -225,4 +225,4 @@ pageClass: custom-page-class
实际运行效果如下(点击图片可放大):
![](https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app-multiport.jpg)
<img src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app-multiport.jpg" loading="lazy" class="zooming"></img>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册