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-parens': [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

Last Updated: 2/3/2019, 2:56:45 AM