Skip to content

Latest commit

 

History

History
52 lines (39 loc) · 963 Bytes

v-on-style.md

File metadata and controls

52 lines (39 loc) · 963 Bytes

Enforce v-on directive style (v-on-style)

  • 🔧 This rule is fixable with eslint --fix command.

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

📖 Rule Details

👎 Examples of incorrect code for this rule:

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

👍 Examples of correct code for this rule:

<template>
    <div>
        <div @click="foo"></div>
    </div>
</template>

👎 Examples of incorrect code for this rule with "longform" option:

<template>
    <div>
        <div @click="foo"></div>
    </div>
</template>

👍 Examples of correct code for this rule with "longform" option:

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

🔧 Options

  • "shorthand" (default) ... requires using shorthand.
  • "longform" ... requires using long form.