MCPcopy Index your code
hub / github.com/keepfool/vue-tutorials / makeChildLinkFn

Function makeChildLinkFn

01.GettingStarted/js/vue.js:7293–7310  ·  view source on GitHub ↗

* Make a child link function for a node's childNodes. * * @param {Array } linkFns * @return {Function} childLinkFn

(linkFns)

Source from the content-addressed store, hash-verified

7291 */
7292
7293 function makeChildLinkFn(linkFns) {
7294 return function childLinkFn(vm, nodes, host, scope, frag) {
7295 var node, nodeLinkFn, childrenLinkFn;
7296 for (var i = 0, n = 0, l = linkFns.length; i < l; n++) {
7297 node = nodes[n];
7298 nodeLinkFn = linkFns[i++];
7299 childrenLinkFn = linkFns[i++];
7300 // cache childNodes before linking parent, fix #657
7301 var childNodes = toArray(node.childNodes);
7302 if (nodeLinkFn) {
7303 nodeLinkFn(vm, node, host, scope, frag);
7304 }
7305 if (childrenLinkFn) {
7306 childrenLinkFn(vm, childNodes, host, scope, frag);
7307 }
7308 }
7309 };
7310 }
7311
7312 /**
7313 * Check for element directives (custom elements that should

Callers 1

compileNodeListFunction · 0.70

Calls 1

toArrayFunction · 0.70

Tested by

no test coverage detected