移除图片加载失败时使用处理逻辑,独立出 plugin-img-error 插件
This commit is contained in:
parent
6c5e034cf0
commit
f1494b23e2
|
@ -207,8 +207,3 @@ spec:
|
|||
value: true
|
||||
- label: 关闭
|
||||
value: false
|
||||
- $formkit: url
|
||||
name: img_error
|
||||
label: 图片加载失败图
|
||||
help: 图片加载失败时显示的图片
|
||||
placeholder: 请输入图片 url
|
|
@ -283,11 +283,4 @@ window.onscroll = function () {
|
|||
};
|
||||
|
||||
|
||||
<!-- 图片 404 -->
|
||||
function imgError(url) {
|
||||
$("img").on("error", function () {
|
||||
$(this).attr("src", url);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -72,12 +72,6 @@
|
|||
heo.categoriesBarActive();
|
||||
heo.initThemeColor();
|
||||
|
||||
if ([[not ${#strings.isEmpty(theme.config.other.img_error)}]]) {
|
||||
imgError([[${theme.config.other.img_error}]]);
|
||||
} else {
|
||||
imgError(/*[[@{/assets/images/404.gif}]]*/)
|
||||
}
|
||||
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
|
|
Loading…
Reference in New Issue