/html
<div id="app">
  
  //对象就是无序键值对的集合   <h1 :style="{ color:red, 'font-weight':200 }">哈哈哈哈哈</h1>
  
  <h1 :style="styleObj"></h1>
  
  <h1 :style="[styleObj,styleObj2]"></h1> </div> //script <script>   var vm = new Vue({     el:'app',     data:{       msg:'点击一下',
      styleObj:{ color:red, 'font-weight':200 },
      styleObj2:{ 'font-style': 'italic' }
    },     methods:{//methods中定义了当前vue实例中所有可用的方法           }   }) </script>

 

相关文章:

  • 2022-01-15
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案