s12e159 v-highlight green
This commit is contained in:
parent
f431c10bbe
commit
ce9df3a9ea
@ -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>
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
import Vue from 'vue'
|
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({
|
||||||
|
Loading…
Reference in New Issue
Block a user