From ebb86dc6757ad5781db0a6c89308701c09d9a57b Mon Sep 17 00:00:00 2001 From: HcySunYang Date: Tue, 23 Oct 2018 04:04:06 +0800 Subject: [PATCH] refactor: set should return early if original def has getter but no setter (#7981) --- src/core/observer/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/observer/index.js b/src/core/observer/index.js index 35469aaf16a..e373716c9f7 100644 --- a/src/core/observer/index.js +++ b/src/core/observer/index.js @@ -179,6 +179,8 @@ export function defineReactive ( if (process.env.NODE_ENV !== 'production' && customSetter) { customSetter() } + // #7981: for accessor properties without setter + if (getter && !setter) return if (setter) { setter.call(obj, newVal) } else {