-
Notifications
You must be signed in to change notification settings - Fork 669
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: #455 #661
fix: #455 #661
Conversation
be90415
to
372ab7b
Compare
This is a good solution, but I'm not sure we should keep it long term. The recent changes to run watchers synchronously has caused lots of bugs. I have a PR open that will add an async option to Vue, so we can set that to make rendering work synchronously—vuejs/vue#8240 I think the solution when we have the async option is to remove the code that sets watchers to sync, because there are too many bugs. Instead we should warn that users with Vue < 2.6 must either update Vue or use Vue.nextTick for updates to the DOM. One question with this PR—I don't think child components will call |
Thank you for reply.
I think |
wrapper.vm.foo = 'bar' | ||
expect(spy.calledOnce).to.equal(true) | ||
expect(fooSpy.calledOnce).to.equal(true) | ||
expect(wrapper.html()).to.equal('<div>bar<div>bar</div></div>') | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question with this PR—I don't think child components will call update with this solution?
Since this test passed, child components are updated.
I think this issue will be fixed in #586 |
Since this change will be unnecessary, I close this pull request. |
I am sorry. It is not problem that If the |
Ok, can you reimplement your original code for update? |
@eddyerburgh |
This is related to #455 and #582.
updated hook is called in
vm._update()
at 2.0.8.https://raw.githubusercontent.com/vuejs/vue/v2.0.8/dist/vue.js
I read below lines.
https://github.com/vuejs/vue/blob/f43ce3a5d8f73e273f2d03c9d86ea5662cda481a/src/core/instance/lifecycle.js#L182-L190
https://github.com/vuejs/vue/blob/653aac2c57d15f0e93a2c1cc7e6fad156658df19/src/core/observer/watcher.js#L187-L202
https://github.com/vuejs/vue/blob/b7445a2b945dcded287601ace8e711ab5cf35ab5/src/core/observer/scheduler.js#L130-L151
https://github.com/vuejs/vue/blob/653aac2c57d15f0e93a2c1cc7e6fad156658df19/src/core/observer/scheduler.js#L35-L94
https://github.com/vuejs/vue/blob/b7445a2b945dcded287601ace8e711ab5cf35ab5/src/core/observer/scheduler.js#L96-L105
https://github.com/vuejs/vue/blob/f43ce3a5d8f73e273f2d03c9d86ea5662cda481a/src/core/instance/lifecycle.js#L315