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

Bug: useEventListener doesn't work correctly with v-if #356

Closed
colgin opened this issue Mar 1, 2021 · 0 comments
Closed

Bug: useEventListener doesn't work correctly with v-if #356

colgin opened this issue Mar 1, 2021 · 0 comments

Comments

@colgin
Copy link
Contributor

colgin commented Mar 1, 2021

reproduce

1: click change button
2. click h1 element, event listener was not invoked

why:
watch callback was pending to pendingPreFlushQueue if instance has been mounted, source code.

Older version of vue works correctly, but after flush arg default value was changed, it broken. issue

how to fix:
Add flush: 'post' in watch

@antfu antfu closed this as completed in c52f70f Mar 1, 2021
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