s12e160 v-highlight red
This commit is contained in:
parent
ce9df3a9ea
commit
21a83d215c
|
@ -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 v-highlight>Color This</p>
|
<p v-highlight='"red"'>Color This</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import App from './App.vue'
|
||||||
|
|
||||||
Vue.directive('highlight', {
|
Vue.directive('highlight', {
|
||||||
bind(el, binding, vnode){
|
bind(el, binding, vnode){
|
||||||
el.style.backgroundColor = 'green'
|
el.style.backgroundColor = binding.value;
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user