Evan You 10 лет назад
Родитель
Сommit
f5fcfb63f2
2 измененных файлов с 3 добавлено и 3 удалено
  1. 2 2
      src/runtime/instance/lifecycle.js
  2. 1 1
      src/runtime/vdom/component.js

+ 2 - 2
src/runtime/instance/lifecycle.js

@@ -19,7 +19,7 @@ export function lifecycleMixin (Vue) {
     if (this._isDestroyed) {
       return
     }
-    this._callHook('beforeDestroy')
+    callHook(this, 'beforeDestroy')
     this._isBeingDestroyed = true
     // teardown watchers
     let i = this._watchers.length
@@ -33,7 +33,7 @@ export function lifecycleMixin (Vue) {
     }
     // call the last hook...
     this._isDestroyed = true
-    this._callHook('destroyed')
+    callHook(this, 'destroyed')
     // turn off all instance listeners.
     this.$off()
   }

+ 1 - 1
src/runtime/vdom/component.js

@@ -43,5 +43,5 @@ function prepatch (oldVnode, vnode) {
 }
 
 function destroy (vnode) {
-  vnode.data.childComponent.$destroy()
+  vnode.data.child.$destroy()
 }