移除图片加载失败时使用处理逻辑,独立出 plugin-img-error 插件

This commit is contained in:
liuzhihang 2022-10-24 22:21:14 +08:00
parent 6c5e034cf0
commit f1494b23e2
3 changed files with 1 additions and 19 deletions

View File

@ -206,9 +206,4 @@ spec:
- label: 开启
value: true
- label: 关闭
value: false
- $formkit: url
name: img_error
label: 图片加载失败图
help: 图片加载失败时显示的图片
placeholder: 请输入图片 url
value: false

View File

@ -283,11 +283,4 @@ window.onscroll = function () {
};
<!-- 图片 404 -->
function imgError(url) {
$("img").on("error", function () {
$(this).attr("src", url);
});
}

View File

@ -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>