Explorar o código

Make StillImage react to src changes

Tusooa Zhu %!s(int64=3) %!d(string=hai) anos
pai
achega
96564609f8
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  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')
+    }
   }
 }