--- pageClass: rule-details sidebarDepth: 0 title: vue/v-on-style description: enforce `v-on` directive style since: v3.0.0 --- # vue/v-on-style > enforce `v-on` directive style - :gear: This rule is included in the following preset configs: - `*.configs["flat/strongly-recommended"]` - `*.configs["flat/vue2-strongly-recommended"]` - `*.configs["flat/recommended"]` - `*.configs["flat/vue2-recommended"]` - `"plugin:vue/strongly-recommended"` - `"plugin:vue/vue2-strongly-recommended"` - `"plugin:vue/recommended"` - `"plugin:vue/vue2-recommended"` - :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fix-problems) can automatically fix some of the problems reported by this rule. ## :book: Rule Details This rule enforces `v-on` directive style which you should use shorthand or long form. ```vue ``` ## :wrench: Options Default is set to `shorthand`. ```json { "vue/v-on-style": ["error", "shorthand" | "longform"] } ``` - `"shorthand"` (default) ... requires using shorthand. - `"longform"` ... requires using long form. ### `"longform"` ```vue ``` ## :couple: Related Rules - [vue/v-on-handler-style](./v-on-handler-style.md) ## :books: Further Reading - [Style guide - Directive shorthands](https://vuejs.org/style-guide/rules-strongly-recommended.html#directive-shorthands) ## :rocket: Version This rule was introduced in eslint-plugin-vue v3.0.0 ## :mag: Implementation - [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/v-on-style.js) - [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/v-on-style.test.ts)