vue/no-unsupported-features
禁止在指定版本上使用不支持的 Vue.js 语法
- 🔧 命令行 上的
--fix
选项可以自动修复此规则报告的一些问题。
📖 规则详细信息
此规则报告在指定版本上不支持的 Vue.js 语法。
🔧 选项
json
{
"vue/no-unsupported-features": ["error", {
"version": "^2.6.0",
"ignores": []
}]
}
version
...version
选项接受node-semver
的有效版本范围。设置您正在使用的 Vue.js 版本。此选项是必需的。ignores
... 您可以使用此ignores
选项来忽略给定的功能。"ignores"
选项接受以下字符串的数组。- Vue.js 3.4.0+
"define-model"
...defineModel()
宏。"v-bind-same-name-shorthand"
...v-bind
同名简写。
- Vue.js 3.3.0+
"define-slots"
...defineSlots()
宏。"define-options"
...defineOptions()
宏。
- Vue.js 3.2.0+
"v-memo"
... v-memo 指令。"v-bind-prop-modifier-shorthand"
...v-bind
带.prop
修饰符简写。"v-bind-attr-modifier"
...v-bind
指令上的.attr
修饰符。
- Vue.js 3.1.0+
"is-attribute-with-vue-prefix"
... 带有vue:
前缀的is
属性
- Vue.js 3.0.0+
"v-model-argument"
...v-model
上的参数"v-model-custom-modifiers"
...v-model
上的自定义修饰符"v-is"
... v-is 指令。
- Vue.js 2.7.0+
"style-css-vars-injection"
... SFC CSS 变量注入"script-setup"
...<script setup>
- Vue.js 2.6.0+
- Vue.js 2.5.0+
"slot-scope-attribute"
... slot-scope 属性。
- Vue.js 3.4.0+
{"version": "^2.6.0"}
{"version": "^2.5.0"}
📚 进一步阅读
- API - defineOptions()
- API - defineSlots()
- API - v-memo
- API - v-is
- API - v-is (旧)
- 指南 - 动态参数
- API - v-slot
- API (v2 版) - slot-scope
- Vue RFCs - 0001-new-slot-syntax
- Vue RFCs - 0002-slot-syntax-shorthand
- Vue RFCs - 0003-dynamic-directive-arguments
- Vue RFCs - 0005-replace-v-bind-sync-with-v-model-argument
- Vue RFCs - 0011-v-model-api-change
- Vue RFCs - 0040-script-setup
- Vue RFCs - 0043-sfc-style-variables
- Vue RFCs - v-bind .prop 简写提案
🚀 版本
此规则在 eslint-plugin-vue v6.1.0 中引入