@@ -248,7 +248,7 @@ describe('codegen', () => {
248
248
)
249
249
} )
250
250
251
- it ( 'generate events with modifiers' , ( ) => {
251
+ it ( 'generate events with generic modifiers' , ( ) => {
252
252
assertCodegen (
253
253
'<input @input.stop="onInput">' ,
254
254
`with(this){return _h('input',{on:{"input":function($event){$event.stopPropagation();onInput($event)}}})}`
@@ -261,21 +261,24 @@ describe('codegen', () => {
261
261
'<input @input.self="onInput">' ,
262
262
`with(this){return _h('input',{on:{"input":function($event){if($event.target !== $event.currentTarget)return;onInput($event)}}})}`
263
263
)
264
+ } )
265
+
266
+ it ( 'generate events with mouse event modifiers' , ( ) => {
264
267
assertCodegen (
265
- '<input @input .ctrl="onInput ">' ,
266
- `with(this){return _h('input',{on:{"input ":function($event){if(!$event.ctrlKey)return;onInput ($event)}}})}`
268
+ '<input @click .ctrl="onClick ">' ,
269
+ `with(this){return _h('input',{on:{"click ":function($event){if(!$event.ctrlKey)return;onClick ($event)}}})}`
267
270
)
268
271
assertCodegen (
269
- '<input @input .shift="onInput ">' ,
270
- `with(this){return _h('input',{on:{"input ":function($event){if(!$event.shiftKey)return;onInput ($event)}}})}`
272
+ '<input @click .shift="onClick ">' ,
273
+ `with(this){return _h('input',{on:{"click ":function($event){if(!$event.shiftKey)return;onClick ($event)}}})}`
271
274
)
272
275
assertCodegen (
273
- '<input @input .alt="onInput ">' ,
274
- `with(this){return _h('input',{on:{"input ":function($event){if(!$event.altKey)return;onInput ($event)}}})}`
276
+ '<input @click .alt="onClick ">' ,
277
+ `with(this){return _h('input',{on:{"click ":function($event){if(!$event.altKey)return;onClick ($event)}}})}`
275
278
)
276
279
assertCodegen (
277
- '<input @input .meta="onInput ">' ,
278
- `with(this){return _h('input',{on:{"input ":function($event){if(!$event.metaKey)return;onInput ($event)}}})}`
280
+ '<input @click .meta="onClick ">' ,
281
+ `with(this){return _h('input',{on:{"click ":function($event){if(!$event.metaKey)return;onClick ($event)}}})}`
279
282
)
280
283
} )
281
284
0 commit comments