Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#8728): only execute the dependArray function once #8734

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(flow): method call error
  • Loading branch information
HcySunYang committed Aug 31, 2018
commit 956e535fe57ec5a788d0005b5ea9074cf9e4cc88
5 changes: 3 additions & 2 deletions src/core/observer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,11 @@ export function defineReactive (
configurable: true,
get: function reactiveGetter () {
const value = getter ? getter.call(obj) : val
if (Dep.target) {
const targetWatcher = Dep.target
if (targetWatcher) {
dep.depend()
if (childOb) {
const needDepend = Array.isArray(value) && !Dep.target.checkRelated(childOb.dep)
const needDepend = Array.isArray(value) && !targetWatcher.checkRelated(childOb.dep)
childOb.dep.depend()
if (needDepend) {
dependArray(value)
Expand Down