Skip to content

Commit

Permalink
更新DOM后才开始执行
Browse files Browse the repository at this point in the history
  • Loading branch information
doom-9-zz committed Jun 15, 2022
1 parent 9c7ba37 commit 9ba60d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/image/src/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
watchEffect,
ImgHTMLAttributes,
onMounted,
onBeforeUnmount
onBeforeUnmount,
watchPostEffect
} from 'vue'
import NImagePreview from './ImagePreview'
import type { ImagePreviewInst } from './ImagePreview'
Expand Down Expand Up @@ -84,7 +85,7 @@ export default defineComponent({
)
})

watchEffect(() => {
watchPostEffect(() => {
if (props.lazy) {
imgObserverHandler(imageRef.value, props.lazyOptions?.root)
} else {
Expand Down

0 comments on commit 9ba60d0

Please sign in to comment.