@@ -30,6 +30,47 @@ describe('mp-alipay: transform v-on', () => {
30
30
`<custom onClick="{{a}}" u-i="2a9ec0b0-0" onVI="__l"/>` ,
31
31
`(_ctx, _cache) => {
32
32
return { a: _o(_ctx.onClick) }
33
+ }`
34
+ )
35
+ } )
36
+ test ( 'event with capture modifier' , ( ) => {
37
+ assert (
38
+ `<view @click.capture="onClick"/>` ,
39
+ `<view capture-onTap="{{a}}"/>` ,
40
+ `(_ctx, _cache) => {
41
+ return { a: _o(_ctx.onClick) }
42
+ }`
43
+ )
44
+ } )
45
+ test ( 'event with stop or prevent modifier' , ( ) => {
46
+ assert (
47
+ `<view @click.stop="onClick"/>` ,
48
+ `<view catchTap="{{a}}"/>` ,
49
+ `(_ctx, _cache) => {
50
+ return { a: _o(_ctx.onClick) }
51
+ }`
52
+ )
53
+ assert (
54
+ `<view @click.prevent="onClick"/>` ,
55
+ `<view catchTap="{{a}}"/>` ,
56
+ `(_ctx, _cache) => {
57
+ return { a: _o(_ctx.onClick) }
58
+ }`
59
+ )
60
+ } )
61
+ test ( 'event with capture modifier and stop or prevent modifier' , ( ) => {
62
+ assert (
63
+ `<view @touchStart.capture.stop="onClick"/>` ,
64
+ `<view capture-catchTouchStart="{{a}}"/>` ,
65
+ `(_ctx, _cache) => {
66
+ return { a: _o(_ctx.onClick) }
67
+ }`
68
+ )
69
+ assert (
70
+ `<view @touchStart.capture.prevent="onClick"/>` ,
71
+ `<view capture-catchTouchStart="{{a}}"/>` ,
72
+ `(_ctx, _cache) => {
73
+ return { a: _o(_ctx.onClick) }
33
74
}`
34
75
)
35
76
} )
0 commit comments