Skip to content

Commit 3627a27

Browse files
committed
ensure custom directive bind is called after node is inserted (close #3529)
1 parent a152fe0 commit 3627a27

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/vdom/modules/directives.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
/* @flow */
22

33
import { resolveAsset } from 'core/util/options'
4+
import { mergeVNodeHook } from 'core/vdom/helpers'
45

56
export default {
67
create: function bindDirectives (oldVnode: VNodeWithData, vnode: VNodeWithData) {
7-
applyDirectives(oldVnode, vnode, 'bind')
8+
mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', () => {
9+
applyDirectives(oldVnode, vnode, 'bind')
10+
})
811
},
912
update: function updateDirectives (oldVnode: VNodeWithData, vnode: VNodeWithData) {
1013
applyDirectives(oldVnode, vnode, 'update')

0 commit comments

Comments
 (0)