Skip to content

Latest commit

 

History

History
77 lines (56 loc) · 1.61 KB

v-on-function-call.md

File metadata and controls

77 lines (56 loc) · 1.61 KB
pageClass sidebarDepth title description
rule-details
0
vue/v-on-function-call
enforce or forbid parentheses after method calls without arguments in `v-on` directives

vue/v-on-function-call

enforce or forbid parentheses after method calls without arguments in v-on directives

  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 Rule Details

👎 Example of incorrect code for this rule:

<button v-on:click="closeModal()">
  Close
</button>

👍 Example of correct code for this rule:

<button v-on:click="closeModal">
  Close
</button>

🔧 Options

Default is set to never.

'vue/v-on-function-call': [2, 'always'|'never']

"always" - Always use parentheses in v-on directives

👎 Example of incorrect code:

<button v-on:click="closeModal">
  Close
</button>

👍 Example of correct code:

<button v-on:click="closeModal()">
  Close
</button>

"never" - Never use parentheses in v-on directives for method calls without arguments

👎 Example of incorrect code:

<button v-on:click="closeModal()">
  Close
</button>

👍 Example of correct code:

<button v-on:click="closeModal">
  Close
</button>

🔍 Implementation