-
Notifications
You must be signed in to change notification settings - Fork 87
Translate: Migration Guide > KeyCode Modifiers #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
potato4d
merged 2 commits into
vuejs-jp:lang-ja
from
shimadev:translate-keycode-modifiers
Nov 10, 2020
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,28 +3,28 @@ badges: | |||||
- breaking | ||||||
--- | ||||||
|
||||||
# KeyCode Modifiers <MigrationBadges :badges="$frontmatter.badges" /> | ||||||
# キーコード修飾子 <MigrationBadges :badges="$frontmatter.badges" /> | ||||||
|
||||||
## Overview | ||||||
## 概要 | ||||||
|
||||||
Here is a quick summary of what has changed: | ||||||
変更点の概要は以下です | ||||||
|
||||||
- **BREAKING**: Using numbers, i.e. keyCodes, as `v-on` modifiers is no longer supported | ||||||
- **BREAKING**: `config.keyCodes` is no longer supported | ||||||
- **破壊的変更**: `v-on`修飾子にキーコードの数字を利用することはサポートされなくなりました | ||||||
- **破壊的変更**: `config.keyCodes` の利用はサポートされなくなりました | ||||||
|
||||||
## 2.x Syntax | ||||||
## 2.x 構文 | ||||||
|
||||||
In Vue 2, `keyCodes` were supported as a way to modify a `v-on` method. | ||||||
Vue 2では、`v-on`メソッドでキーコードを利用することができました。 | ||||||
|
||||||
```html | ||||||
<!-- keyCode version --> | ||||||
<!-- キーコードを利用した場合 --> | ||||||
<input v-on:keyup.13="submit" /> | ||||||
|
||||||
<!-- alias version --> | ||||||
<!-- エイリアスを利用した場合 --> | ||||||
<input v-on:keyup.enter="submit" /> | ||||||
``` | ||||||
|
||||||
In addition, you could define your own aliases via the global `config.keyCodes` option. | ||||||
さらに、`config.keyCodes`のグローバルオプションを利用することで、独自のエイリアスを定義できました。 | ||||||
|
||||||
```js | ||||||
Vue.config.keyCodes = { | ||||||
|
@@ -33,24 +33,24 @@ Vue.config.keyCodes = { | |||||
``` | ||||||
|
||||||
```html | ||||||
<!-- keyCode version --> | ||||||
<!-- キーコードを利用した場合 --> | ||||||
<input v-on:keyup.112="showHelpText" /> | ||||||
|
||||||
<!-- custom alias version --> | ||||||
<!-- 独自のエイリアスを利用した場合 --> | ||||||
<input v-on:keyup.f1="showHelpText" /> | ||||||
``` | ||||||
|
||||||
## 3.x Syntax | ||||||
## 3.x 構文 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
ここ申し訳ないのですが、 |
||||||
|
||||||
Since [`KeyboardEvent.keyCode` has been deprecated](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode), it no longer makes sense for Vue 3 to continue supporting this as well. As a result, it is now recommended to use the kebab-case name for any key you want to use as a modifier. | ||||||
[`KeyboardEvent.keyCode` は非推奨](https://developer.mozilla.org/ja/docs/Web/API/KeyboardEvent/keyCode)となり、Vue 3においても引き続きサポートすることはもはや意味がありません。そのため、修飾子に利用したいキーのケバブケース名を利用することが推奨されます。 | ||||||
|
||||||
```html | ||||||
<!-- Vue 3 Key Modifier on v-on --> | ||||||
<!-- Vue 3 の v-on でキー修飾子を利用する場合 --> | ||||||
<input v-on:keyup.delete="confirmDelete" /> | ||||||
``` | ||||||
|
||||||
As a result, this means that `config.keyCodes` is now also deprecated and will no longer be supported. | ||||||
`config.keyCodes`の利用も同様の理由で非推奨となり、サポートされなくなりました。 | ||||||
|
||||||
## Migration Strategy | ||||||
## 移行方法 | ||||||
|
||||||
For those using `keyCode` in their codebase, we recommend converting them to their kebab-cased named equivalents. | ||||||
キーコードを利用している場合は、ケバブケース名を利用する方法に変更することを推奨します。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
日本語として少し違和感があるので、 naming を |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここ申し訳ないのですが、
での構文
で統一させてほしいです!