Jelajahi Sumber

comments for fragment

Evan You 10 tahun lalu
induk
melakukan
6b447f7113
1 mengubah file dengan 20 tambahan dan 0 penghapusan
  1. 20 0
      src/fragment/fragment.js

+ 20 - 0
src/fragment/fragment.js

@@ -37,6 +37,14 @@ function Fragment (linker, vm, frag, host, scope, parentFrag) {
   this.node.__vfrag__ = this
 }
 
+/**
+ * Call attach/detach for all components contained within
+ * this fragment. Also do so recursively for all child
+ * fragments.
+ *
+ * @param {Function} hook
+ */
+
 Fragment.prototype.callHook = function (hook) {
   var i, l
   for (i = 0, l = this.children.length; i < l; i++) {
@@ -134,12 +142,24 @@ function multiRemove () {
   }
 }
 
+/**
+ * Call attach hook for a Vue instance.
+ *
+ * @param {Vue} child
+ */
+
 function attach (child) {
   if (!child._isAttached) {
     child._callHook('attached')
   }
 }
 
+/**
+ * Call detach hook for a Vue instance.
+ *
+ * @param {Vue} child
+ */
+
 function detach (child) {
   if (child._isAttached) {
     child._callHook('detached')