bind class
This commit is contained in:
parent
e5aa5d8f32
commit
22129d13ab
|
@ -14,7 +14,9 @@ var app = new Vue({
|
|||
{ id: 2, text: 'Learn Vue' },
|
||||
{ id: 3, text: 'Build something awesome' }
|
||||
],
|
||||
label: 'You loaded this page on ' + new Date().toLocaleString()
|
||||
label: 'You loaded this page on ' + new Date().toLocaleString(),
|
||||
isActive: true,
|
||||
hasError: false
|
||||
},
|
||||
methods: {
|
||||
reverseMessage: function () {
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
<button v-on:click="reverseMessage">Reverse Message</button>
|
||||
|
||||
<input v-model="message"> <span>{{ lenMessage }}</span>
|
||||
|
||||
<p class="static" v-bind:class="{ active: isActive, 'text-danger': hasError }">class</p>
|
||||
</div>
|
||||
|
||||
<script src="app.js"></script>
|
||||
|
|
Loading…
Reference in New Issue