案例:Vue.js案例     状态:可编辑再运行    进入横版
x
        'text-danger': this.error && this.error.type === 'fatal',
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<title>Vue 测试实例 - W3xue教程(w3xue.com)</title>
6
<script src="//unpkg.com/vue/dist/vue.js"></script>
7
<style>
8
.active {
9
    width: 100px;
10
    height: 100px;
11
    background: green;
12
}
13
.text-danger {
14
    background: red;
15
}
16
</style>
17
</head>
18
<body>
19
<div id="app">
20
  <div v-bind:class="classObject"></div>
21
</div>
22
23
<script>
24
new Vue({

 运行结果 
 北美留学生论坛