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 } }

猜你喜欢

转载自www.cnblogs.com/wenhandi/p/9779968.html