Przeglądaj źródła

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

Evan You 11 lat temu
rodzic
commit
47107c101a
1 zmienionych plików z 3 dodań i 2 usunięć
  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