MCPcopy Create free account
hub / github.com/ygs-code/vue / createElement$1

Function createElement$1

vue.js:7717–7730  ·  view source on GitHub ↗
(tagName, vnode)

Source from the content-addressed store, hash-verified

7715 创建一个真实的dom
7716 */
7717 function createElement$1(tagName, vnode) {
7718 //创建一个真实的dom
7719 var elm = document.createElement(tagName);
7720 if (tagName !== 'select') { //如果不是select标签则返回dom出去
7721 return elm
7722 }
7723 // false or null will remove the attribute but undefined will not
7724 // false或null将删除属性,但undefined不会
7725 if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) { //如果是select标签 判断是否设置了multiple属性。如果设置了则加上去
7726
7727 elm.setAttribute('multiple', 'multiple');
7728 }
7729 return elm
7730 }
7731
7732 //XML createElementNS() 方法可创建带有指定命名空间的元素节点。
7733 //createElement差不多 创建一个dom节点

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected