Skip to content

bug about keep-alive and @click.native caused repeated attach event handler? #10083

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

Closed
action-hong opened this issue May 29, 2019 · 2 comments · Fixed by #10085
Closed

bug about keep-alive and @click.native caused repeated attach event handler? #10083

action-hong opened this issue May 29, 2019 · 2 comments · Fixed by #10085

Comments

@action-hong
Copy link

Version

2.6.10

Reproduction link

https://codepen.io/action-hong/pen/eaKmOy

Steps to reproduce

  1. click "show/hide button" to hide button "add 1"
  2. click "show/hide button" to show button "add 1"
  3. click "add 1"

What is expected?

Repeat step 1 and step 2, Click the "add 1" to add 1 to the number

What is actually happening?

Repeat step 1 and step 2 , Click the "add 1" to add n(repeat times) to the number


5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36

@posva
Copy link
Member

posva commented May 29, 2019

Seems like a bug indeed. As a workaround, you can pass a regular @click and handle it manually with $listeners.click

<button @click="$listeners.click">{{ text }}</button>

@SpiritMark

This comment has been minimized.

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

Successfully merging a pull request may close this issue.

3 participants