Skip to content

vue/use-v-on-exact

enforce usage of exact modifier on v-on

  • ⚙️ This rule is included in all of "plugin:vue/essential", *.configs["flat/essential"], "plugin:vue/vue2-essential", *.configs["flat/vue2-essential"], "plugin:vue/strongly-recommended", *.configs["flat/strongly-recommended"], "plugin:vue/vue2-strongly-recommended", *.configs["flat/vue2-strongly-recommended"], "plugin:vue/recommended", *.configs["flat/recommended"], "plugin:vue/vue2-recommended" and *.configs["flat/vue2-recommended"].

📖 Rule Details

This rule enforce usage of exact modifier on v-on when there is another v-on with modifier.

<template> <!-- ✓ GOOD --> <button @click="foo" :click="foo"></button> <button v-on:click.exact="foo" v-on:click.ctrl="foo"></button> <!-- ✗ BAD --> <button v-on:click="foo" v-on:click.ctrl="foo"></button> </template>
Now loading...

🔧 Options

Nothing.

📚 Further Reading

🚀 Version

This rule was introduced in eslint-plugin-vue v5.0.0

🔍 Implementation