vue+乾坤中,子应用鼠标事件错误问题

 在主应用中会增加shadowRoot,因此document.getElementById("asideId")是无法获得节点的

正确使用:document.getElementById("sonList").firstElementChild.shadowRoot.getElementById("asideId");

 

同理:节点属性也是一样

 var ddd= document.getElementById("sonList").firstElementChild.shadowRoot.getElementById("asideId").getElementsByTagName("input")[0];
    
     ddd.onclick=function(){
       var ccc=ddd.getAttribute("aria-describedby");
 console.log(ccc);

 var aaa=document.getElementById(ccc)
//  aaa.setAttribute("aria-hidden","false")
 aaa.style.zIndex="2023"
aaa.style.position="absolute"
aaa.style.left="286px"
aaa.style.top="157px"
aaa.style.margin="0px"
aaa.style.display="block"
     } 

  

posted @ 2021-12-16 17:50  龙丶谈笑风声  阅读(99)  评论(0)    收藏  举报