File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ export const nextTick: NextTick = function nextTick(
77 this : ThisType < NextTick > ,
88 ...args : Parameters < NextTick >
99) {
10- return currentVue ?. nextTick . bind ( this , args )
10+ return currentVue ?. nextTick . apply ( this , args )
1111} as any
Original file line number Diff line number Diff line change @@ -26,4 +26,27 @@ describe('nextTick', () => {
2626 } )
2727 } )
2828 } )
29+
30+ it ( 'should works with await' , async ( ) => {
31+ const vm = new Vue ( {
32+ template : `<div>{{a}}</div>` ,
33+ setup ( ) {
34+ return {
35+ a : ref ( 1 ) ,
36+ }
37+ } ,
38+ } ) . $mount ( )
39+
40+ expect ( vm . $el . textContent ) . toBe ( '1' )
41+ vm . a = 2
42+ expect ( vm . $el . textContent ) . toBe ( '1' )
43+
44+ await nextTick ( )
45+ expect ( vm . $el . textContent ) . toBe ( '2' )
46+ vm . a = 3
47+ expect ( vm . $el . textContent ) . toBe ( '2' )
48+
49+ await nextTick ( )
50+ expect ( vm . $el . textContent ) . toBe ( '3' )
51+ } )
2952} )
You can’t perform that action at this time.
0 commit comments