Skip to content

Commit

Permalink
bug: bug(directive): fix guard checking at unbind
Browse files Browse the repository at this point in the history
closes #340
  • Loading branch information
kazupon committed Jun 22, 2018
1 parent 7bfe26b commit c74888c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export function update (el: any, binding: Object, vnode: any, oldVNode: any): vo
}

export function unbind (el: any, binding: Object, vnode: any, oldVNode: any): void {
if (!assert(el, vnode)) { return }
const vm: any = vnode.context
if (!vm) {
warn('not exist Vue instance in VNode context')
return
}

el.textContent = ''
el._vt = undefined
Expand Down

0 comments on commit c74888c

Please sign in to comment.