Vue技术内幕 出去看看吧 榨干部分小细节
vue\src\platforms\web\entry-runtime-with-compiler.js
/** * Get outerHTML of elements, taking care * of SVG elements in IE as well. */ function getOuterHTML (el: Element): string { if (el.outerHTML) { return el.outerHTML } else { const container = document.createElement('div')
//true 递归复制当前节点的所有子孙节点, false 复制当前节点 container.appendChild(el.cloneNode(true))
//innerHTML 返回元素内容 return container.innerHTML } }
转载请注明出处
水平有限,错误在所难免,抛砖引玉,意在交流学习