fix: keep-alive component data should not be updated (#5188)

This commit is contained in:
Xin Du (Clark) 2019-03-08 16:43:27 +00:00 committed by GitHub
parent 3e678793b9
commit 1ea86617ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -491,6 +491,7 @@ function fixPrepatch(to, ___) {
if ( if (
instance.constructor._dataRefresh && instance.constructor._dataRefresh &&
Components[i] === instance.constructor && Components[i] === instance.constructor &&
instance.$vnode.data.keepAlive !== true &&
typeof instance.constructor.options.data === 'function' typeof instance.constructor.options.data === 'function'
) { ) {
const newData = instance.constructor.options.data.call(instance) const newData = instance.constructor.options.data.call(instance)