We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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-bind 配合 mip-img 使用的时候会导致报错。 <mip-img m-bind:src="xxx.com/123.jpg"></mip-img>
<mip-img m-bind:src="xxx.com/123.jpg"></mip-img>
原因: 因为 mip-bind 的时候触发了 mip-img 组件里边的 attributeChangedCallback。
mip/src/components/mip-img.js
Lines 299 to 303 in 92530d8
而对于mip-img来说,如果组件没有进入视口范围的话,里边是没有创建img标签的。上面的代码 Line 301 就会报错。
解决办法:
customElem.prototype.attributeChangedCallback = function (attributeName, oldValue, newValue, namespace) { var img = this.element.querySelector('img'); if (img && attributeName === 'src' && oldValue !== newValue) { img.src = newValue; } };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
场景:
mip-bind 配合 mip-img 使用的时候会导致报错。
<mip-img m-bind:src="xxx.com/123.jpg"></mip-img>
原因:
因为 mip-bind 的时候触发了 mip-img 组件里边的 attributeChangedCallback。
mip/src/components/mip-img.js
Lines 299 to 303 in 92530d8
而对于mip-img来说,如果组件没有进入视口范围的话,里边是没有创建img标签的。上面的代码 Line 301 就会报错。
解决办法:
The text was updated successfully, but these errors were encountered: