s12e160 v-highlight red

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

View File

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

View File

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