mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
Check for component options data
This commit is contained in:
parent
8ab7d4f0df
commit
42dc15e72e
@ -147,7 +147,7 @@ function fixPrepatch (to, ___) {
|
|||||||
let instances = getMatchedComponentsInstances(to)
|
let instances = getMatchedComponentsInstances(to)
|
||||||
_lastComponentsFiles = instances.map((instance, i) => {
|
_lastComponentsFiles = instances.map((instance, i) => {
|
||||||
if (!instance) return '';
|
if (!instance) return '';
|
||||||
if (_lastPaths[i] === instance.constructor._path) {
|
if (_lastPaths[i] === instance.constructor._path && typeof instance.constructor.options.data === 'function') {
|
||||||
let newData = instance.constructor.options.data()
|
let newData = instance.constructor.options.data()
|
||||||
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