Skip to content

Files

Latest commit

 

History

History
53 lines (36 loc) · 920 Bytes

v-on-style.md

File metadata and controls

53 lines (36 loc) · 920 Bytes

Pattern: Malformed v-on directive

Issue: -

Description

This rule enforces v-on directive style which you should use shorthand or long form.

<template>
  <!-- ✓ GOOD -->
  <div @click="foo"/>

  <!-- ✗ BAD -->
  <div v-on:click="foo"/>
</template>

Options

Default is set to shorthand.

{
  "vue/v-on-style": ["error", "shorthand" | "longform"]
}
  • "shorthand" (default) ... requires using shorthand.
  • "longform" ... requires using long form.

"longform"

<template>
  <!-- ✓ GOOD -->
  <div v-on:click="foo"/>

  <!-- ✗ BAD -->
  <div @click="foo"/>
</template>

Further Reading