8000 Clarify valid use of exact with no system modifiers (#1303) · mstetsyk/vuejs.org@11cd248 · GitHub
[go: up one dir, main page]

Skip to content

Commit 11cd248

Browse files
mokkabonnachrisvfritz
authored andcommitted
Clarify valid use of exact with no system modifiers (vuejs#1303)
* clarify valid use of exact with no system modifiers * Disambiguate description of .exact modifier
1 parent 5562241 commit 11cd248

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/v2/guide/events.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,17 @@ For example:
286286

287287
> New in 2.5.0+
288288
289-
The `.exact` modifier should be used in combination with other system modifiers to indicate that the exact combination of modifiers must be pressed for the handler to fire.
289+
The `.exact` modifier allows control of the exact combination of system modifiers needed to trigger an event.
290290

291291
``` html
292292
<!-- this will fire even if Alt or Shift is also pressed -->
293293
<button @click.ctrl="onClick">A</button>
294294

295-
<!-- this will only fire when only Ctrl is pressed -->
295+
<!-- this will only fire when Ctrl and no other keys are pressed -->
296296
<button @click.ctrl.exact="onCtrlClick">A</button>
297+
298+
<!-- this will only fire when no system modifiers are pressed -->
299+
<button @click.exact="onClick">A</button>
297300
```
298301

299302
### Mouse Button Modifiers

0 commit comments

Comments
 (0)
0