Skip to content

Commit d60cf86

Browse files
committed
the bind directive hook
1 parent 5ee0e61 commit d60cf86

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ <h1 v-switching-color:fast.underline.textcenter="colors">Vue School</h1>
1010
</div>
1111

1212
<script type="text/javascript">
13-
Vue.directive('switching-color', function (el, binding) {
13+
Vue.directive('switching-color', {
14+
bind (el, binding) {
1415
const modifiers = binding.modifiers
1516
if (modifiers.underline) {
1617
el.style.textDecoration = 'underline'
@@ -36,6 +37,7 @@ <h1 v-switching-color:fast.underline.textcenter="colors">Vue School</h1>
3637
i = 0
3738
}
3839
}, speed)
40+
}
3941
})
4042

4143
new Vue({

0 commit comments

Comments
 (0)