Skip to content

vue/valid-next-tick ​

强制使用有效的 nextTick 函数调用

  • ⚙️ 此规则包含在 "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.

  • 💡此规则报告的某些问题可以通过编辑器 suggestions 手动修复。

    ¥💡 Some problems reported by this rule are manually fixable by editor suggestions.

📖 规则详情 ​

在不传递回调且不等待返回的 Promise 的情况下调用 Vue.nextTick 或 vm.$nextTick 很可能是一个错误(可能是缺少 await)。

¥Calling Vue.nextTick or vm.$nextTick without passing a callback and without awaiting the returned Promise is likely a mistake (probably a missing await).

Now loading...

🔧选项 ​

¥🔧 Options

无。

¥Nothing.

📚扩展阅读 ​

¥📚 Further Reading

🚀版本 ​

¥🚀 Version

此规则在 eslint-plugin-vue v7.5.0 中引入

¥This rule was introduced in eslint-plugin-vue v7.5.0

🔍代码实现 ​

¥🔍 Implementation

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