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 {