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

APP中视频点击播放时,控制台报错[Vue warn]: Error in v-on handler: "TypeError: Cannot read property 'name' of undefined" #617

Open
woxiaoyao81 opened this issue Oct 25, 2024 · 0 comments

Comments

@woxiaoyao81
Copy link

使用环境

APP中点击视频播放时,在控制吧报错[Vue warn]: Error in v-on handler: "TypeError: Cannot read property 'name' of undefined"

问题描述

[Vue warn]: Error in v-on handler: "TypeError: Cannot read property 'name' of undefined"
found in
<Node> at uni_modules/mp-html/components/mp-html/node/node.vue:1... (1 recursive calls)
    <MpHtml> at uni_modules/mp-html/components/mp-html/mp-html.vue:1

复现方式

APP端mp-html加载带有视频的html字符串,然后点击视频播放,在控制台将报这个错误

解决问题

通过调试发现,play中代码是

 const i = e.currentTarget.dataset.i;
 const node = this.childs[i];

在APP端e.currentTarget.dataset.i是undefined,所以读取不了视频信息,建议可修改成 const i = e.currentTarget.dataset.i||0;,然后就可以正常获取视频信息了

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