Przeglądaj źródła

fix directive teardown when no watcher is present

Evan You 11 lat temu
rodzic
commit
ffbd3eea94
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      src/directive.js

+ 3 - 1
src/directive.js

@@ -145,7 +145,9 @@ p._teardown = function () {
     if (this.unbind) {
       this.unbind()
     }
-    this._watcher.teardown()
+    if (this._watcher) {
+      this._watcher.teardown()
+    }
     this._bound = false
   }
 }