在Vue3中nextTick是如何保证顺序的
nextTick
在Vue3的源码中的实现,从源码之没有看到控制的相关信息,那么必定是与参数p
有关。追踪一下p
相关的参数
const resolvedPromise = Promise.resolve() as Promise<any>
let currentFlushPromise: Promise<void> | null = null
export function nextTick<T = void>(
this: T,
fn?: (this: T) => void
): <