element-plus/packages/test-utils/tick.ts
jeremywu de0696b4f6
core/bumping-dependency-vue-version (#729)
* bumping version

* build(core): bumping vue version

- Bumping up vue version from ^3.0.0 to ^3.0.3 due to the change of `emitOptions`

* Remove transition mock/Add before-enter and before-leave hook emitter for popper
2020-12-01 10:28:42 +08:00

20 lines
380 B
TypeScript

import { nextTick } from 'vue'
const tick = async (times: number) => {
while (times--) {
await nextTick()
}
}
export default tick
// in order to test transitions, we need to use
// await rAF() after firing transition events.
export const rAF = async () => {
return new Promise(res => {
requestAnimationFrame(() => {
requestAnimationFrame(res)
})
})
}