You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/v2/guide/events.md
+20-9Lines changed: 20 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -207,15 +207,15 @@ Remembering all the keyCodes is a hassle, so Vue provides aliases for the most c
207
207
208
208
Here's the full list of key modifier aliases:
209
209
210
-
- enter
211
-
- tab
212
-
- delete (captures both "Delete" and "Backspace" keys)
213
-
- esc
214
-
- space
215
-
-up
216
-
- down
217
-
- left
218
-
- right
210
+
-`.enter`
211
+
-`.tab`
212
+
-`.delete` (captures both "Delete" and "Backspace" keys)
213
+
-`.esc`
214
+
-`.space`
215
+
-`.up`
216
+
-`.down`
217
+
-`.left`
218
+
-`.right`
219
219
220
220
You can also [define custom key modifier aliases](../api/#keyCodes) via the global `config.keyCodes` object:
221
221
@@ -224,6 +224,17 @@ You can also [define custom key modifier aliases](../api/#keyCodes) via the glob
224
224
Vue.config.keyCodes.f1=112
225
225
```
226
226
227
+
## Mouse Event Modifiers
228
+
229
+
> New in 2.1.0
230
+
231
+
You can use the following modifiers to trigger mouse event listeners only when the corresponding key is pressed:
232
+
233
+
-`.ctrl`
234
+
-`.alt`
235
+
-`.shift`
236
+
-`.meta`
237
+
227
238
## Why Listeners in HTML?
228
239
229
240
You might be concerned that this whole event listening approach violates the good old rules about "separation of concerns". Rest assured - since all Vue handler functions and expressions are strictly bound to the ViewModel that's handling the current view, it won't cause any maintenance difficulty. In fact, there are several benefits in using `v-on`:
0 commit comments