mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-17 06:01:34 +00:00
fix: Use Component instead of paths
This commit is contained in:
parent
c6553a39cd
commit
fe30ef3525
@ -393,11 +393,12 @@ function fixPrepatch(to, ___) {
|
|||||||
Vue.nextTick(() => {
|
Vue.nextTick(() => {
|
||||||
const matches = []
|
const matches = []
|
||||||
const instances = getMatchedComponentsInstances(to, matches)
|
const instances = getMatchedComponentsInstances(to, matches)
|
||||||
|
const Components = getMatchedComponents(to, matches)
|
||||||
|
|
||||||
instances.forEach((instance, i) => {
|
instances.forEach((instance, i) => {
|
||||||
if (!instance) return
|
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 (!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)
|
const newData = instance.constructor.options.data.call(instance)
|
||||||
for (let key in newData) {
|
for (let key in newData) {
|
||||||
Vue.set(instance.$data, key, newData[key])
|
Vue.set(instance.$data, key, newData[key])
|
||||||
|
Loading…
Reference in New Issue
Block a user