s12e159 v-highlight green

This commit is contained in:
Tyrel Souza 2018-04-20 15:26:35 -04:00
parent f431c10bbe
commit ce9df3a9ea
No known key found for this signature in database
GPG Key ID: 5A9394D4C30AEAC0
2 changed files with 5 additions and 2 deletions

View File

@ -10,7 +10,7 @@
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3"> <div class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3">
<h1>Custom Directives</h1> <h1>Custom Directives</h1>
<p>Color This</p> <p v-highlight>Color This</p>
</div> </div>
</div> </div>
</div> </div>

View File

@ -2,7 +2,10 @@ import Vue from 'vue'
import App from './App.vue' import App from './App.vue'
Vue.directive('highlight', { Vue.directive('highlight', {
bind(el, binding, vnode){
el.style.backgroundColor = 'green'
}
}) })
new Vue({ new Vue({