Match-id-2a52349292593a758f5be74be4ea3f24ef9a5509
This commit is contained in:
parent
d8f6349c31
commit
fdc7a831d1
|
@ -44,8 +44,10 @@ function updateOneProp(dom, propName, propVal, isNativeTag, isInit?: boolean) {
|
|||
} else if (propName === 'dangerouslySetInnerHTML') {
|
||||
dom.innerHTML = propVal.__html;
|
||||
} else if (propName === 'children') { // 只处理纯文本子节点,其他children在VNode树中处理
|
||||
if (typeof propVal === 'string' || typeof propVal === 'number') {
|
||||
dom.textContent = String(propVal);
|
||||
if (typeof propVal === 'string') {
|
||||
dom.textContent = propVal;
|
||||
} else if (typeof propVal === 'number') {
|
||||
dom.textContent = propVal + ''; // 这种数字转字符串的方式效率最高
|
||||
}
|
||||
} else if (isEventProp(propName)) {
|
||||
// 事件监听属性处理
|
||||
|
|
Loading…
Reference in New Issue