소스 검색

Make StillImage react to src changes

Tusooa Zhu 3 년 전
부모
커밋
96564609f8
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      src/components/still-image/still-image.js

+ 8 - 0
src/components/still-image/still-image.js

@@ -57,6 +57,14 @@ const StillImage = {
     onError () {
       this.imageLoadError && this.imageLoadError()
     }
+  },
+  watch: {
+    src () {
+      this.realSrc = this.src
+    },
+    dataSrc () {
+      this.$el.removeAttribute('data-loaded')
+    }
   }
 }