Переглянути джерело

Define unlink functions in init
... so that we don't accidentally fallback to parent's unlink fns
when an instance with `inherti:true` is destroyed. Fixes #791.

Evan You 11 роки тому
батько
коміт
99f011b066
1 змінених файлів з 8 додано та 1 видалено
  1. 8 1
      src/instance/init.js

+ 8 - 1
src/instance/init.js

@@ -48,7 +48,14 @@ exports._init = function (options) {
   // children
   this._children = []
   this._childCtors = {}
-  // transcluded components that belong to the parent
+
+  // transclusion unlink functions
+  this._containerUnlinkFn =
+  this._contentUnlinkFn = null
+
+  // transcluded components that belong to the parent.
+  // need to keep track of them so that we can call
+  // attached/detached hooks on them.
   this._transCpnts = null
 
   // merge options.