Sfoglia il codice sorgente

watcher should only update for objects if it is a deep watch

Evan You 11 anni fa
parent
commit
47107c101a
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      src/watcher.js

+ 3 - 2
src/watcher.js

@@ -158,8 +158,9 @@ p.run = function () {
   if (this.active) {
     var value = this.get()
     if (
-      (typeof value === 'object' && value !== null) ||
-      value !== this.value
+      value !== this.value ||
+      Array.isArray(value) ||
+      this.deep
     ) {
       var oldValue = this.value
       this.value = value