如何在 eslint 中禁用 "non-interactive elements with click handlers must have at least one keyboard listener" 规则?

How to disable "non-interactive elements with click handlers must have at least one keyboard listener" rule in eslint?

例如,每当我编写一个没有 onKeyUponClick 事件属性时,eslint 就会引发错误 Visible, non-interactive elements with click handlers must have at least one keyboard listener,我不知道如何禁用此规则。我该怎么做?

'jsx-a11y/click-events-have-key-events': 'off' 在你的 eslint 配置中应该禁用它。

rules 下 eslintrc.js

vuejs-accessibility/click-events-have-key-events': 'off',