knockout框架学习(一)--virtualElement.js(2)元素操作
1、childNodes 获取子节点
childNodes: function(node) { return isStartComment(node) ? getVirtualChildren(node) : node.childNodes; }
2、emptyNode 清空子节点
emptyNode: function(node) { if (!isStartComment(node))// 如果非ko开始节点 ko.utils.emptyDomNode(node); else { var virtualChildren = ko.virtualElements.childNodes(node); for (var i = 0, j = virtualChildren.length; i < j; i++) ko.removeNode(virtualChildren[i]); } }
标题:knockout框架学习(一)--virtualElement.js(2)元素操作
作者:hugh0524
地址:https://blog.uproject.cn/articles/2017/07/06/1499320631253.html
0 0