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

this.store.set 使用点设置值会导致修改时取值错误 #576

Open
Happy-DJ opened this issue Oct 25, 2020 · 0 comments
Open

this.store.set 使用点设置值会导致修改时取值错误 #576

Happy-DJ opened this issue Oct 25, 2020 · 0 comments

Comments

@Happy-DJ
Copy link

Happy-DJ commented Oct 25, 2020


this.store.set(this.store.data,'apply.form.personAddress',11111)
修改值的时候会在$observerPath下创建新变量 apply.form.personAddress,
{ $observerPath:'#', apply:{ list:[], form:{id:'',personAddress:''} }, apply.form.personAddress:1111 }

这个时候如果通过apply.form修改了personAddress值,这个时候并不会修改$observerPath生成的'apply.form.personAddress'值,导致重新修改值父判断为未修改

比如

  1. this.store.set(this.store.data,'apply.form.personAddress',11111)
  2. this.store.set(this.store.data,'apply.form',{personAddress:''})
  3. this.store.set(this.store.data,'apply.form.personAddress',11111)

这个时候第三步修改失败,
obaa.js onPropertyChanged 判断value等于oldValue 不进行修改

测试
prop = ‘apply.form.personAddress’
this.$observeProps[prop] = 'abvc' // 会创建新key 'apply.form.personAddress':'abvc'
this.$observeProps['apply']['form']['unitAddress'] = 'bbbbbbb' // 修改不会信创建信key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant