Appearance
vue/no-ref-as-operand
禁止使用
ref()
(Composition API)封装的值作为操作数
- ⚙️ 此规则包含在
"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"
和*.configs["flat/vue2-recommended"]
中。
🔧命令行 上的
--fix
选项可以自动修复此规则报告的一些问题。¥🔧 The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
📖 规则详情
此规则报告将 ref 错误地用作操作数的情况。你必须使用 .value
来访问 Ref
值。
¥This rule reports cases where a ref is used incorrectly as an operand.\ You must use .value
to access the Ref
value.
🔧选项
¥🔧 Options
无。
¥Nothing.
📚扩展阅读
¥📚 Further Reading
指南 - 反应性 - 反应性基础 / 创建独立的反应性值作为
refs
¥Guide - Reactivity - Reactivity Fundamentals / Creating Standalone Reactive Values as
refs
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue v7.0.0 中引入
¥This rule was introduced in eslint-plugin-vue v7.0.0
🔍代码实现
¥🔍 Implementation