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

在 created/onLoad 中触发 setter,组件的 props 并不会更新 #62

Closed
BuptStEve opened this issue Nov 16, 2018 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@BuptStEve
Copy link
Member

因为在 observer 里用 Promise 异步触发更新,所以这个更新会覆盖 created/onLoad 中触发的 setter

Promise.resolve().then(function () {
    this[name] = value
})

改成同步触发就行

this[name] = value
@BuptStEve BuptStEve added the bug Something isn't working label Nov 16, 2018
@BuptStEve BuptStEve self-assigned this Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant