Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 57c7406

Browse files
mouse event modifiers
1 parent 5d853b4 commit 57c7406

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

‎src/v2/guide/events.md‎

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ Remembering all the keyCodes is a hassle, so Vue provides aliases for the most c
207207

208208
Here's the full list of key modifier aliases:
209209

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`
219219

220220
You can also [define custom key modifier aliases](../api/#keyCodes) via the global `config.keyCodes` object:
221221

@@ -224,6 +224,17 @@ You can also [define custom key modifier aliases](../api/#keyCodes) via the glob
224224
Vue.config.keyCodes.f1 = 112
225225
```
226226

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+
227238
## Why Listeners in HTML?
228239

229240
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

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /