Skip to content

Commit b808e8a

Browse files
committed
docs: extra examples of migrating keyCode modifiers
vuejs/docs@afc2a95
1 parent 31417bd commit b808e8a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/guide/migration/keycode-modifiers.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ Vue.config.keyCodes = {
4646

4747
```html
4848
<!-- Vue 3 の v-on でキー修飾子を利用する場合 -->
49-
<input v-on:keyup.delete="confirmDelete" />
49+
<input v-on:keyup.page-down="nextPage">
50+
51+
<!-- Matches both q and Q -->
52+
<input v-on:keypress.q="quit">
5053
```
5154

5255
`config.keyCodes` の利用も同様の理由で非推奨となり、サポートされなくなりました。
@@ -55,6 +58,14 @@ Vue.config.keyCodes = {
5558

5659
キーコードを利用している場合は、ケバブケースでの命名に変更することを推奨します。
5760

61+
The keys for some punctuation marks can just be included literally. e.g. For the `,` key:
62+
63+
```html
64+
<input v-on:keypress.,="commaPress">
65+
```
66+
67+
Limitations of the syntax prevent certain characters from being matched, such as `"`, `'`, `/`, `=`, `>`, and `.`. For those characters you should check `event.key` inside the listener instead.
68+
5869
[移行ビルドのフラグ:](migration-build.html#compat-の設定)
5970

6071
- `CONFIG_KEY_CODES`

0 commit comments

Comments
 (0)