代码实现:


  





.search {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  background-color: greenyellow;
}

输出结果:

vue3 使用ref 获取 dom 元素的高度插图

 

本站无任何商业行为
个人在线分享 » vue3 使用ref 获取 dom 元素的高度
E-->