Match-id-2a52349292593a758f5be74be4ea3f24ef9a5509

This commit is contained in:
* 2022-01-26 14:53:36 +08:00 committed by *
parent d8f6349c31
commit fdc7a831d1
1 changed files with 4 additions and 2 deletions

View File

@ -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)) {
// 事件监听属性处理