vue3学习笔记 2021-06-14
## 自定义指令
1. 定义:
```js
app.directive('name', {
// 在元素的 attribute 或事件侦听器应用之前调用
created(el, binding, vnode) {},
// 指令绑定到元素后发生。只发生一次, 同2.x的bind
beforeMount(el, binding, vnode) {},
// 元素插入父 DOM ## 自定义指令
1. 定义:
```js
app.directive('name', {
// 在元素的 attribute 或事件侦听器应用之前调用
created(el, bindin
查看更多