From 66124e5bceaaf40a831bd04a9bf14a2cc169d05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Tue, 20 Dec 2016 12:55:25 +0100 Subject: [PATCH] Dont use _routerViewCache anymore --- lib/app/client.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/app/client.js b/lib/app/client.js index c938cd6abe..6cc5a5d6c9 100644 --- a/lib/app/client.js +++ b/lib/app/client.js @@ -142,18 +142,11 @@ function render (to, from, next) { // When navigating on a different route but the same component is used, Vue.js // will not update the instance data, so we have to update $data ourselves function fixPrepatch (to, ___) { - if (!this.$nuxt._routerViewCache || !this.$nuxt._routerViewCache.default) { - return - } Vue.nextTick(() => { let instances = getMatchedComponentsInstances(to) - instances.forEach((instance) => { + instances.forEach((instance, i) => { if (!instance) return; - let file = instance.$parent._routerViewCache.default.__file - if (typeof instance.$parent._routerViewCache.default === 'function') { - file = instance.$parent._routerViewCache.default.options.__file - } - if (instance.constructor.options.__file === file) { + if (_lastPaths[i] === instance.constructor._path) { let newData = instance.constructor.options.data() for (let key in newData) { Vue.set(instance.$data, key, newData[key])