Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

Commit c74888c

Browse files
committed
bug: bug(directive): fix guard checking at unbind
closes #340
1 parent 7bfe26b commit c74888c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/directive.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ export function update (el: any, binding: Object, vnode: any, oldVNode: any): vo
1717
}
1818

1919
export function unbind (el: any, binding: Object, vnode: any, oldVNode: any): void {
20-
if (!assert(el, vnode)) { return }
20+
const vm: any = vnode.context
21+
if (!vm) {
22+
warn('not exist Vue instance in VNode context')
23+
return
24+
}
2125

2226
el.textContent = ''
2327
el._vt = undefined

0 commit comments

Comments
 (0)