mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-21 02:50:11 +08:00
fix(components): lazy image is not work when it changes src (#3189)
This commit is contained in:
parent
2f9cdc74ce
commit
c572d5e6e3
@ -301,12 +301,17 @@ export default defineComponent({
|
||||
emit('switch', val)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.src,
|
||||
() => {
|
||||
watch(() => props.src, () => {
|
||||
if (props.lazy) {
|
||||
// reset status
|
||||
loading.value = true
|
||||
hasLoadError.value = false
|
||||
removeLazyLoadListener()
|
||||
nextTick(addLazyLoadListener)
|
||||
} else {
|
||||
loadImage()
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
if (props.lazy) {
|
||||
|
Loading…
Reference in New Issue
Block a user