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

lazyLoad提示未定义 #513

Closed
woxiaoyao81 opened this issue May 5, 2023 · 1 comment
Closed

lazyLoad提示未定义 #513

woxiaoyao81 opened this issue May 5, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@woxiaoyao81
Copy link

使用环境

mp-html版本号:v2.4.1,HbuilderX版本3.7.11,微信小程序没有问题,APP中使用图片懒加载lazyLoad

问题描述

一般是在初次时,会报node.vue中lazyLoad未定义错误

复现方式

content是包括图片html

<mp-html lazy-load container-style="padding:5px 10px;font-size:1.2em;" :content="content"/>

加载时有时报会报node.vue中lazyLoad未定义错误,经查源码初步定位于node的mounted中获取根节点部分代码的问题

this.$nextTick(() => {
  for (this.root = this.$parent; this.root.$options.name !== 'mp-html'; this.root = this.root.$parent);
})	

APP端应该渲染太快,this.root并不是根节点,此时访问this.root.lazyLoad导致报错

@jin-yufeng
Copy link
Owner

暂时没复现出来,不过可能出现的话加个条件判断好了

@jin-yufeng jin-yufeng added the bug Something isn't working label May 13, 2023
sonofmagic added a commit to sonofmagic/mp-html that referenced this issue Jun 26, 2023
commit d67be37
Author: Jin Yufeng <1750665@tongji.edu.cn>
Date:   Sun May 14 21:00:47 2023 +0800

    release v2.4.2

commit 9acb1d3
Author: Jin Yufeng <1750665@tongji.edu.cn>
Date:   Sun May 14 20:06:00 2023 +0800

    修复了 editable 插件点击音视频时其他标签框不消失的问题

commit 09c8d42
Author: Jin Yufeng <1750665@tongji.edu.cn>
Date:   Sun May 14 19:39:26 2023 +0800

    editable 插件支持修改文字颜色 jin-yufeng#254

commit 0a18c02
Author: Jin Yufeng <1750665@tongji.edu.cn>
Date:   Sun May 14 11:47:55 2023 +0800

    修复了 uni-app 包使用旧版编译器可能报错的问题 jin-yufeng#472

commit 2d0821f
Author: Jin Yufeng <1750665@tongji.edu.cn>
Date:   Sat May 13 17:25:52 2023 +0800

    修复了 svg 中有 style 不生效的问题 jin-yufeng#505

commit 8e50ea7
Author: Jin Yufeng <1750665@tongji.edu.cn>
Date:   Sat May 13 16:20:05 2023 +0800

    修复了 uni-app 包 app 端可能出现无法读取 lazyLoad 的问题 jin-yufeng#513

commit 38402ca
Author: Jin Yufeng <1750665@tongji.edu.cn>
Date:   Sat May 13 15:32:39 2023 +0800

    修复了latex插件部分情况下不显示的问题 jin-yufeng#515

commit ca66d5e
Merge: c0b780b 380c674
Author: jin-yufeng <48236054+jin-yufeng@users.noreply.github.com>
Date:   Fri Mar 24 21:21:55 2023 +0800

    Merge pull request jin-yufeng#497 from TwoKe945/master

    fix: 修复editable插件在点击换图时,出现的domain前缀未添加的问题

commit 380c674
Author: TwoKe <twoke945@163.com>
Date:   Mon Mar 13 15:58:43 2023 +0800

    fix: 图片设置超链接以及预览图链接url转化

commit ebd1bba
Author: TwoKe <twoke945@163.com>
Date:   Sun Mar 12 23:01:07 2023 +0800

    fix: miniprogram平台node.js Parser引入路径错误

commit 4060075
Author: TwoKe <twoke945@163.com>
Date:   Sun Mar 12 22:57:23 2023 +0800

    chore: 更换getImgUrl为通用url解析函数Parser.getUrl

commit 467cc0f
Author: TwoKe <twoke945@163.com>
Date:   Sun Mar 12 21:09:38 2023 +0800

    fix: 修复editable插件在点击换图时,出现的domain前缀未添加的问题
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants