Skip to content

vue/no-unsupported-features

禁止在指定版本上使用不支持的 Vue.js 语法

  • 🔧 command line 上的 --fix 选项可以自动修复此规则报告的一些问题。

📖 规则详情

此规则报告指定版本上不支持的 Vue.js 语法。

¥This rule reports unsupported Vue.js syntax on the specified version.

🔧选项

¥🔧 Options

json
{
  "vue/no-unsupported-features": ["error", {
    "version": "^2.6.0",
    "ignores": []
  }]
}
  • version ...version 选项接受 node-semver 的有效版本范围。设置你正在使用的 Vue.js 版本。此选项是必需的。

    ¥version ... The version option accepts the valid version range of node-semver. Set the version of Vue.js you are using. This option is required.

  • ignores ...你可以使用此 ignores 选项来忽略给定的功能。"ignores" 选项接受以下字符串的数组。

    ¥ignores ... You can use this ignores option to ignore the given features. The "ignores" option accepts an array of the following strings.

    • Vue.js 3.4.0+

      • "define-model" ...defineModel() 宏。

        ¥"define-model" ... defineModel() macro.

      • "v-bind-same-name-shorthand" ...v-bind 同名简写。

        ¥"v-bind-same-name-shorthand" ... v-bind same-name shorthand.

    • Vue.js 3.3.0+

      • "define-slots" ...defineSlots() 宏。

        ¥"define-slots" ... defineSlots() macro.

      • "define-options" ...defineOptions() 宏。

        ¥"define-options" ... defineOptions() macro.

    • Vue.js 3.2.0+

      • "v-memo" ...v-memo 指令。

        ¥"v-memo" ... v-memo directive.

      • "v-bind-prop-modifier-shorthand" ...v-bind 带有 .prop 修饰符简写。

        ¥"v-bind-prop-modifier-shorthand" ... v-bind with .prop modifier shorthand.

      • "v-bind-attr-modifier" ...v-bind 指令上的 .attr 修饰符。

        ¥"v-bind-attr-modifier" ... .attr modifier on v-bind directive.

    • Vue.js 3.1.0+

    • Vue.js 3.0.0+

    • Vue.js 2.7.0+

    • Vue.js 2.6.0+

    • Vue.js 2.5.0+

{"version": "^2.6.0"}

Now loading...

{"version": "^2.5.0"}

Now loading...

📚扩展阅读

¥📚 Further Reading

🚀版本

¥🚀 Version

此规则在 eslint-plugin-vue v6.1.0 中引入

¥This rule was introduced in eslint-plugin-vue v6.1.0

🔍代码实现

¥🔍 Implementation

eslint-plugin-vue v10.0 中文网 - 粤ICP备13048890号