1. v-bind:class(根据需求进行选择)

<style>
.box{
    background-color: #ff0;
}
.textColor{
    color: #000;
}
.textSize{
    font-size: 30px;
}
</style>

<div id="app">
    <span class="box" :class="{'textColor':isColor, 'textSize':isSize}">我是字</span>
</div>

<script>
  new Vue({
      el: "#app",
  data:{
      isColor:true,
      isSize:true
  }
  })
</script>

方法1
1.1

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2021-10-02
猜你喜欢
  • 2022-12-23
  • 2021-05-15
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案