Check for component options data

This commit is contained in:
Sébastien Chopin 2016-12-20 14:11:51 +01:00
parent 8ab7d4f0df
commit 42dc15e72e

View File

@ -147,7 +147,7 @@ function fixPrepatch (to, ___) {
let instances = getMatchedComponentsInstances(to)
_lastComponentsFiles = instances.map((instance, i) => {
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()
for (let key in newData) {
Vue.set(instance.$data, key, newData[key])