From 724974ecff0302c25f94209d76514e53f32b6262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Pol=C3=A1=C5=A1ek?= Date: Sat, 19 Nov 2016 10:55:04 +0100 Subject: [PATCH] :bug: bug(observer): fix dep undefined error (#88) by @fandaa --- src/config.js | 2 +- src/observer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.js b/src/config.js index a54e52aab..363d4207a 100644 --- a/src/config.js +++ b/src/config.js @@ -16,7 +16,7 @@ export default function (Vue, langVM, lang) { return function computedGetter () { watcher.dirty && watcher.evaluate() - Dep.target && watcher.depend() + Dep && Dep.target && watcher.depend() return watcher.value } } diff --git a/src/observer.js b/src/observer.js index 09f24e875..4e9632f8b 100644 --- a/src/observer.js +++ b/src/observer.js @@ -28,7 +28,7 @@ let Dep */ export function getDep (vm) { - if (!Dep) { + if (!Dep && vm && vm._data && vm._data.__ob__ && vm._data.__ob__.dep) { Dep = vm._data.__ob__.dep.constructor } return Dep