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

Dynamic event name binding with nullish value not working #2388

Closed
07akioni opened this issue Oct 16, 2020 · 2 comments · Fixed by #2393
Closed

Dynamic event name binding with nullish value not working #2388

07akioni opened this issue Oct 16, 2020 · 2 comments · Fixed by #2393
Labels
has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working

Comments

@07akioni
Copy link
Contributor

Version

3.0.1

Reproduction link

https://codesandbox.io/s/vue3-event-bug-pc5ug?file=/src/App.vue

Steps to reproduce

follow the link

What is expected?

no error like vue2, see

https://codesandbox.io/s/vue2-event-kvjlb?file=/src/App.vue:0-476

What is actually happening?

error happened

@posva posva added ✨ feature request New feature or request has workaround A workaround has been found to avoid the problem labels Oct 16, 2020
@posva
Copy link
Member

posva commented Oct 16, 2020

You can use an empty string as a workaround

@LinusBorg
Copy link
Member

The compiler doesn't actually account for a dynamic non-null value, but I think we still support this, so it's rather a bug.

_createVNode("button", {
  ["on" + _capitalize($options.ev)]: _cache[2] || (_cache[2] = (...args) => ($options.handleClick(...args)))

The compiler should skip adding that prop to the vNode if !$options.ev

@LinusBorg LinusBorg added 🐞 bug Something isn't working and removed ✨ feature request New feature or request labels Oct 16, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Nov 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants