From c74888cd54810e59babc5e49e3b88a9b9dff6dcd Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Fri, 22 Jun 2018 20:30:08 +0900 Subject: [PATCH] bug: bug(directive): fix guard checking at unbind closes #340 --- src/directive.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/directive.js b/src/directive.js index bd09689f1..35cb55cd2 100644 --- a/src/directive.js +++ b/src/directive.js @@ -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