Prechádzať zdrojové kódy

Make StillImage react to src changes

Tusooa Zhu 3 rokov pred
rodič
commit
96564609f8
1 zmenil súbory, kde vykonal 8 pridanie a 0 odobranie
  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')
+    }
   }
 }