Repository: vue-a11y/eslint-plugin-vuejs-accessibility (ts)

Issue:
click-event-has-key-events doesn't always pick up click directive
A co-worker noticed some inconsistency on when this rule throws an error. In our particular use case, these two versions throw the linting error as expected:

```vue
<button @click.prevent="isExpanded = !isExpanded">
```

```vue
<button @click.prevent="toggleIsExpanded()">
```

However, this one doesn't throw the linting error.

```vue
<button @click.prevent="toggleIsExpanded">
```

This is in Vue 3, for what it's worth.

Pull request description:
Fix for #145
Fixes #145

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e0c077e..917e6d9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
 
 ## [Unreleased]
 
+### Changed
+
+- Ensure directives that have identifiers for values are counted as present in the element.
+
 ## [0.6.2] - 2021-05-26
 
 ### Changed
diff --git a/src/utils/hasOnDirective.js b/src/utils/hasOnDirective.js
index bf02201..50aae24 100644
--- a/src/utils/hasOnDirective.js
+++ b/src/utils/hasOnDirective.js
@@ -9,7 +9,7 @@ const hasOnDirective = (node, name) =>
       key.argument.name === name &&
       value &&
       value.expression &&
-      !!value.expression.body
+      (value.expression.type === "Identifier" || !!value.expression.body)
     );
   });
 


Test patch:
diff --git a/src/rules/__tests__/click-events-have-key-events.test.js b/src/rules/__tests__/click-events-have-key-events.test.js
index e3cc07b..6b0c209 100644
--- a/src/rules/__tests__/click-events-have-key-events.test.js
+++ b/src/rules/__tests__/click-events-have-key-events.test.js
@@ -27,6 +27,7 @@ makeRuleTester("click-events-have-key-events", rule, {
     "<Button @click='void 0' />"
   ],
   invalid: [
+    "<div @click='toggle'>",
     "<div @click='void 0' />",
     "<div @click='void 0' role='undefined' />",
     "<section @click='void 0' />",