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

A method's name passed to v-on:click can't begin with "function" and a Capitalized word #10177

Closed
PaulEdouardB opened this issue Jun 21, 2019 · 1 comment

Comments

@PaulEdouardB
Copy link

Version

2.6.10

Reproduction link

https://jsfiddle.net/abn13gqy/

Steps to reproduce

  • Add a @click handler to a component
  • Pass a function with parameter called with a name that begin with "function" a Capitalized word
  • Run

What is expected?

The function should run only on click

What is actually happening?

The function is run as soon as the component is loaded
A TypeError is thrown: _vm.function in not a function or handler is undefined


I believe that the vue compiler parse "functionName(param)" as "function Name(param)" thus as the parsed string is evaluated, the function runs immediately when loaded

@jacekkarczmarczyk
Copy link

In fact in doesn't need to be capital letter, functiontest also fails

@Justineo
Copy link
Member

It's already fixed in #9922. But it seems that the latest release is published before it.

/cc @yyx990803 Let's see if it's time for a new patch release.

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

3 participants