vue/next-tick-style
在
nextTick中强制使用 Promise 或回调风格
- 🔧 命令行 上的
--fix选项可以自动修复此规则报告的一些问题。
📖 规则详情
此规则强制执行在 Vue.nextTick 和 this.$nextTick 中应该使用回调版本还是 Promise 版本(在 Vue v2.1.0 中引入)。
正在加载...
🔧 选项
默认设置为 promise。
json
{
"vue/next-tick-style": ["error", "promise" | "callback"]
}"promise"(默认) ... 要求使用 Promise 版本。"callback"... 要求使用回调版本。如果您使用的是低于 v2.1.0 的 Vue 版本,请使用此选项。
"callback"
正在加载...
📚 进一步阅读
- Vue 2 中的
Vue.nextTickAPI - Vue 2 中的
vm.$nextTickAPI - 全局 API 树摇
- Vue 3 中的全局
nextTickAPI - Vue 3 中的实例
$nextTickAPI
🚀 版本
此规则在 eslint-plugin-vue v7.5.0 中引入