提交 d8bfa65c 作者: 方治民

fix: 修复 CacheImage 组件没有使用懒加载机制问题

上级 88b8c6a9
......@@ -34,11 +34,8 @@
},
})
const visibleSrc = ref()
const visibleSrc = ref(props.src)
const hashCacheKey = ref()
onMounted(async () => {
await tryCache()
})
// 监听 src 变化
watch(
......@@ -149,6 +146,7 @@
:background="props.background"
:src="visibleSrc"
@error="onError"
@visible="tryCache"
>
<slot></slot>
</fui-lazyload>
......
......@@ -12,7 +12,7 @@
<script>
export default {
name: "fui-lazyload",
emits: ['error', 'load', 'click'],
emits: ['error', 'load', 'click', 'visible'],
// #ifdef MP-WEIXIN
options: {
virtualHost: true
......@@ -146,6 +146,7 @@
this.visible = false;
setTimeout(() => {
this.visible = true;
this.$emit('visible', {})
}, 500)
},
endObserver() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论