@@ -248,7 +248,7 @@ describe('codegen', () => {
248248 )
249249 } )
250250
251- it ( 'generate events with modifiers' , ( ) => {
251+ it ( 'generate events with generic modifiers' , ( ) => {
252252 assertCodegen (
253253 '<input @input.stop="onInput">' ,
254254 `with(this){return _h('input',{on:{"input":function($event){$event.stopPropagation();onInput($event)}}})}`
@@ -261,21 +261,24 @@ describe('codegen', () => {
261261 '<input @input.self="onInput">' ,
262262 `with(this){return _h('input',{on:{"input":function($event){if($event.target !== $event.currentTarget)return;onInput($event)}}})}`
263263 )
264+ } )
265+
266+ it ( 'generate events with mouse event modifiers' , ( ) => {
264267 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)}}})}`
267270 )
268271 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)}}})}`
271274 )
272275 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)}}})}`
275278 )
276279 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)}}})}`
279282 )
280283 } )
281284
0 commit comments