From 8f890abcd22fc99259a60eb5b9f4e5416d3e40af Mon Sep 17 00:00:00 2001 From: JMRY <376509849@qq.com> Date: Fri, 19 Jan 2024 17:18:04 +0800 Subject: [PATCH] =?UTF-8?q?-=20Version:=201.1.10=20Build=2020240119=20=09-?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E8=A1=A8=E6=A0=BC=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E7=9A=84bug=E3=80=82=20=09-=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DInvalid=20prop=20`attr`=E8=AD=A6=E5=91=8A=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION.md | 4 +++ react.extensions.dom.js | 60 ++++++++++++++++++++++------------------- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/VERSION.md b/VERSION.md index ec6d03d..db94d1e 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,5 +1,9 @@ # JQuery DOM +- Version: 1.1.10 Build 20240119 + - 修复表格重复输出的bug。 + - 修复Invalid prop `attr`警告。 + - Version: 1.1.9 Build 20240118 - 修复限制只有一个children时,无法被部分插件识别的bug。 diff --git a/react.extensions.dom.js b/react.extensions.dom.js index 4251aa9..c01c5ba 100644 --- a/react.extensions.dom.js +++ b/react.extensions.dom.js @@ -17,13 +17,13 @@ function reactDOMHtml(dom_tag,dom_attr,dom_html,dom_html_after){ tag:undefined,attr:undefined,html:undefined, }; for(let cur of dom_tag){ - cur={ - ...default_children, - ...cur, - }; - if(cur.$$typeof){ + if(typeof cur==`object` && cur.$$typeof){ domFullObject.push(cur); // 已被React.createElement封装的情况下,不再重新封装 - }else{ + }else if(cur && typeof cur==`object`){ + cur={ + ...default_children, + ...cur, + }; domFullObject.push(reactDOMHtml(cur,undefined,undefined)); } } @@ -122,34 +122,38 @@ function reactDOMHtml(dom_tag,dom_attr,dom_html,dom_html_after){ //表格语法糖 if(typeof dom_attr==`object` && (typeof dom_attr.tbody==`object` || typeof dom_attr.tr==`object`)){ let reactDOMTbody={tag:`tbody`,children:[]}; - let default_tr={ - tag:`tr`,attr:undefined,html:undefined,children:[], - }; - let default_td={ - tag:`td`,attr:undefined,html:undefined,children:[], - } let trList=dom_attr.tbody || dom_attr.tr; for(let i=0; i