From fe30ef35258a24e9743784bbab27880423b12c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Fri, 4 May 2018 11:36:10 +0200 Subject: [PATCH] fix: Use Component instead of paths --- lib/app/client.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/app/client.js b/lib/app/client.js index d5c10ba24b..33949f98c2 100644 --- a/lib/app/client.js +++ b/lib/app/client.js @@ -393,11 +393,12 @@ function fixPrepatch(to, ___) { Vue.nextTick(() => { const matches = [] const instances = getMatchedComponentsInstances(to, matches) + const Components = getMatchedComponents(to, matches) instances.forEach((instance, i) => { if (!instance) return // if (!this._queryChanged && to.matched[matches[i]].path.indexOf(':') === -1 && to.matched[matches[i]].path.indexOf('*') === -1) return // If not a dynamic route, skip - if (instance.constructor._dataRefresh && _lastPaths[i] === instance.constructor._path && typeof instance.constructor.options.data === 'function') { + if (instance.constructor._dataRefresh && Components[i] === instance.constructor && typeof instance.constructor.options.data === 'function') { const newData = instance.constructor.options.data.call(instance) for (let key in newData) { Vue.set(instance.$data, key, newData[key])