pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
vue/no-direct-composable-in-event-handler |
disallow direct composable usage in event handler |
v10.1.0 |
disallow direct composable usage in event handler
- ⚙️ This rule is included in all of
"plugin:vue/essential"
,*.configs["flat/essential"]
,"plugin:vue/strongly-recommended"
,*.configs["flat/strongly-recommended"]
,"plugin:vue/recommended"
and*.configs["flat/recommended"]
.
This rule prevents directly calling a composable function in an event handler.
This rule prevents directly calling a composable function in an event handler. If something starts with use
, it is considered a composable function.
<template>
<!-- ✗ BAD -->
<button @click="useFoo">Click me</button>
</template>
<script setup>
function useFoo() {}
</script>
This rule was introduced in eslint-plugin-vue v10.1.0