HTML
CSS
JavaScript
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>v-bind 指令 - IT书包(www.itshubao.com)</title>
<script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>
</head>

<body>
<div id="app">
  <label for="r1">修改颜色</label><input type="checkbox" v-model="class1" id="r1">
  <br><br>
  <div v-bind:class="{'class1': class1}">
    directiva v-bind:class
  </div>
</div>
</body>
</html>
CSS
.class1{
  background: #444;
  color: #eee;
}
JavaScript
new Vue({
	el: '#app',
  data:{
  	class1: false
  }
});