vue/valid-next-tick
强制执行有效的
nextTick函数调用
- ⚙️ 此规则包含在所有
"plugin:vue/vue3-essential"、*.configs["flat/essential"]、"plugin:vue/essential"、*.configs["flat/vue2-essential"]、"plugin:vue/vue3-strongly-recommended"、*.configs["flat/strongly-recommended"]、"plugin:vue/strongly-recommended"、*.configs["flat/vue2-strongly-recommended"]、"plugin:vue/vue3-recommended"、*.configs["flat/recommended"]、"plugin:vue/recommended"和*.configs["flat/vue2-recommended"]中。 - 🔧 命令行 上的
--fix选项可以自动修复此规则报告的一些问题。 - 💡 此规则报告的一些问题可以通过编辑器 建议 手动修复。
📖 规则详情
调用 Vue.nextTick 或 vm.$nextTick 时,如果没有传递回调函数并且没有等待返回的 Promise,则很可能是一个错误(可能是缺少 await)。
正在加载...
🔧 选项
无。
📚 进一步阅读
- Vue 2 中的
Vue.nextTickAPI - Vue 2 中的
vm.$nextTickAPI - 全局 API Tree-shaking
- Vue 3 中的全局
nextTickAPI - Vue 3 中的实例
$nextTickAPI
🚀 版本
此规则是在 eslint-plugin-vue v7.5.0 中引入的。