From 6e5909869c0f2896c5d4b7d8b1145c50803136b4 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 35469aaf16..e373716c9f 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 {