Skip to content

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

Closed
@PaulEdouardB

Description

@PaulEdouardB

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions