1 | // 注册一个全局自定义指令 `v-focus` |
1 | directives: { |
1 | <input v-focus> |
这里举一个高深的例子
1 | <div id="hook-arguments-example" v-demo:foo.a.b="message"></div> |
1 | Vue.directive('demo', { |
简写模式
1 |
|
接收数据
1 | <div v-demo="{ color: 'white', text: 'hello!' }"></div> |
1 | Vue.directive('demo', function (el, binding) { |