MCPcopy Create free account
hub / github.com/ygs-code/vue / getOuterHTML

Function getOuterHTML

vue.js:15975–15984  ·  view source on GitHub ↗

* Get outerHTML of elements, taking care * of SVG elements in IE as well. *获取 dom的html //outerHTML 输出当前标签的本身和标签内的文本内容,如果有子标签,那么子标签本身和标签内的文本内容也将一起输出

(el)

Source from the content-addressed store, hash-verified

15973 *获取 dom的html //outerHTML 输出当前标签的本身和标签内的文本内容,如果有子标签,那么子标签本身和标签内的文本内容也将一起输出
15974 */
15975 function getOuterHTML(el) {
15976 if (el.outerHTML) { //
15977 return el.outerHTML
15978 } else {
15979 //创建一个div节点 并且 包裹着el
15980 var container = document.createElement('div');
15981 container.appendChild(el.cloneNode(true));
15982 return container.innerHTML
15983 }
15984 }
15985
15986 Vue.compile = compileToFunctions;
15987

Callers 1

vue.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected