我正在尝试在dom-repeat模板中提取产品图像,但404由于缺少资源出现在console.log. 我想用更多合法错误清理日志。
<template is="dom-repeat" items="" index-as="index">
<lazy-image class="center"
placeholder="/images/placeholder.png"
src="https://www.images.com/[[formatImg(item.id)]].png"
style="width: 24pt; height: 24pt;">
</lazy-image>
</template>
...
formatImg(id) {
if(typeof id != 'null') return id.replace(' ', '%20');
}
我看过一些关于on-error事件的文档,但没有看到将它们实现到 Polymer 框架中的直接路径。
有没有办法处理这些GET请求,以免它们被记录?