馬老師DDD+SOA的事件驅(qū)動(dòng)微服務(wù)讀寫(xiě)分離架構(gòu)
2022-10-26 16:10 作者:娜娜絡(luò)絡(luò) | 我要投稿
// 獲取 props children
?const childrenLength = arguments.length - 2;
?if(childrenLength === 1) {
? ?props.children = children;
?} else if(childrenLength > 1) {
? ?const childArray = Array(childrenLength); ?// 如果多個(gè)元素,置為數(shù)組
? ?for(let i = 0; i < childrenLength; i++) {
? ? ?childArray[i] = arguments[i+2];
? ?}
? ?props.children = childArray;
?}
標(biāo)簽: