mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-06 21:10:38 +00:00
Dont use _routerViewCache anymore
This commit is contained in:
parent
2e2062e045
commit
66124e5bce
@ -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])
|
||||
|
Loading…
Reference in New Issue
Block a user