Vue.js style (内联样式)

demo 

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Vue</title>
  <script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>
</head>
<body>
<div id="six">
  <div v-bind:style="{ color: activeColor, fontSize: fontSize + 'px' }">努力向上</div>
</div>

<script>
  new Vue({
    el: '#six',
    data: {
      activeColor: 'blue',
      fontSize: 20

    }
  })
</script>
</body>
</html>

  效果:

posted @ 2018-03-20 13:58  1点  阅读(395)  评论(0编辑  收藏  举报