1. style

  可以通过

:style="{height:`${heightData.main}px`}"

实现样式的动态绑定, style绑定的是一个对象,多个样式时用“,”隔开, 要用驼峰式写法.

2. class

  

<div :class="{ active: isActive }"></div>

可以动态控制class的名, 绑定的对象或者数组, 通过判断isActive的真假来动态控制它显示

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-25
  • 2021-11-29
  • 2021-06-25
  • 2021-08-20
  • 2021-10-26
  • 2021-10-06
  • 2022-12-23
相关资源
相似解决方案