vue mounted中监听div的变化

<div style="width:200px;height:30px;background: #0e90d2" >{{$store.state.msg}}</div>



methods: {

fun(){
this.$store.dispatch('fun',this.checkedNames);

},

 

 

mounted(){
document.getElementById('list').addEventListener("DOMSubtreeModified", function(){
var he=document.getElementById('list').offsetHeight;

document.getElementById('list2').style.height=he+'px';
console.log(he);
}, false)
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2021-06-17
猜你喜欢
  • 2021-06-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
相关资源
相似解决方案