From ece535cdbdbd9a3e57d565070c39070e48feb7c8 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Thu, 20 Jan 2022 10:43:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=89=88=E6=9C=AC=E5=AF=B9=E6=AF=94):=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=AF=B9=E6=AF=94=E7=AE=97=E6=B3=95=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=8A=A0=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1009791--user=郭雨琦 【性能测试】版本对比,一样的地方也标注了 --- .../components/performance/v_node_diff.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/frontend/src/business/components/performance/v_node_diff.js b/frontend/src/business/components/performance/v_node_diff.js index b5683dc45a..e1b2d205f1 100644 --- a/frontend/src/business/components/performance/v_node_diff.js +++ b/frontend/src/business/components/performance/v_node_diff.js @@ -210,7 +210,7 @@ function sameDetail(oldVnode,newVnode,sameNode){ if(isDef(oldVnode.children)&&isDef(newVnode.children)){ sameChildren(oldVnode.children,newVnode.children,sameNode) } - //剩最后的子节点的时候,分类型做判断 + //剩最后的子节点的时候,分类型做判断,如果最后的子节点有一个不相同,sameNode就置空, if(isUndef(oldVnode.child)&&isUndef(newVnode.child)&&isUndef(oldVnode.children)&&isUndef(newVnode.children)){ if(isDef(oldVnode.text)&&isDef(newVnode.text)){ if(oldVnode.text===newVnode.text){ @@ -233,6 +233,12 @@ function sameDetail(oldVnode,newVnode,sameNode){ }else{ sameNode.nodeArray = []; } + }else if(oldVnode.tag==='textarea'&&newVnode.tag==='textarea'){ + if(oldVnode.elm.value===newVnode.elm.value){ + sameNode.nodeArray.push(newVnode.elm); + }else { + sameNode.nodeArray = []; + } } } else { @@ -288,7 +294,7 @@ function diffDetail(oldVnode,newVnode,diffNode){ diffNode.nodeArray.push(newVnode.elm); } }else if(isDef(oldVnode.tag)&&isDef(newVnode.tag)){ - if((oldVnode.tag==='input'&&newVnode.tag==='input')||(oldVnode.tag==='textarea'&&newVnode.tag==='textarea')){ + if(oldVnode.tag==='input'&&newVnode.tag==='input'){ if(oldVnode.elm.value!==newVnode.elm.value){ diffNode.oldNodeArray.push(oldVnode.elm); diffNode.nodeArray.push(newVnode.elm); @@ -300,6 +306,11 @@ function diffDetail(oldVnode,newVnode,diffNode){ } } } + }else if(oldVnode.tag==='textarea'&&newVnode.tag==='textarea'){ + if(oldVnode.elm.value!==newVnode.elm.value){ + diffNode.oldNodeArray.push(oldVnode.elm); + diffNode.nodeArray.push(newVnode.elm); + } } } else {