Skip to content

Commit fc2cee4

Browse files
authored
Merge pull request #490 from kikd/translate-style-guide
2 parents 6f7b925 + e610ad3 commit fc2cee4

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

Diff for: src/style-guide/README.md

+23-22
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ sidebar: auto
2828
2. ほとんどのコミュニティのコードサンプルを変更なしにコピーして貼り付ける事ができます。
2929
3. 少なくとも Vue に関しては、ほとんどの場合、新たな人材はあなたのコーディングスタイルよりも既に慣れ親しんだものを好みます。
3030

31-
### 優先度 D: 使用注意
31+
### 優先度 D: 注意して使用
3232

3333
Vue のいくつかの機能は、レアケースまたは従来のコードベースからスムーズな移行に対応するために存在します。しかしながらこれを使いすぎると、コードを保守することが難しくなり、またバグの原因になることさえあります。これらのルールは潜在的な危険な機能を照らし、いつ、なぜ避けなかればならないのかを説明しています。
3434

@@ -1473,22 +1473,22 @@ computed: {
14731473
```
14741474
</div>
14751475

1476-
## Priority D Rules: Use with Caution <span class="hide-from-sidebar">(Potentially Dangerous Patterns)</span>
1476+
## 優先度 D のルール: 注意して使用 <span class="hide-from-sidebar">(潜在的に危険なパターン)</span>
14771477

1478-
### Element selectors with `scoped` <sup data-p="d">use with caution</sup>
1478+
### `scoped` 付きの要素セレクタ <sup data-p="d">注意して使用</sup>
14791479

1480-
**Element selectors should be avoided with `scoped`.**
1480+
**`scoped` 付きの要素セレクタは避けるべきです。**
14811481

1482-
Prefer class selectors over element selectors in `scoped` styles, because large numbers of element selectors are slow.
1482+
たくさんの要素セレクタは低速になるため、 `scoped` スタイルでは要素セレクタよりもクラスセレクタを優先してください。
14831483

1484-
::: details Detailed Explanation
1485-
To scope styles, Vue adds a unique attribute to component elements, such as `data-v-f3f3eg9`. Then selectors are modified so that only matching elements with this attribute are selected (e.g. `button[data-v-f3f3eg9]`).
1484+
::: details 詳細な説明
1485+
スタイルの範囲を決めるために、 Vue `data-v-f3f3eg9` のような一意の属性をコンポーネントの要素に追加します。
14861486

1487-
The problem is that large numbers of [element-attribute selectors](http://stevesouders.com/efws/css-selectors/csscreate.php?n=1000&sel=a%5Bhref%5D&body=background%3A+%23CFD&ne=1000) (e.g. `button[data-v-f3f3eg9]`) will be considerably slower than [class-attribute selectors](http://stevesouders.com/efws/css-selectors/csscreate.php?n=1000&sel=.class%5Bhref%5D&body=background%3A+%23CFD&ne=1000) (e.g. `.btn-close[data-v-f3f3eg9]`), so class selectors should be preferred whenever possible.
1487+
問題は、 たくさんの[要素-属性セレクタ](http://stevesouders.com/efws/css-selectors/csscreate.php?n=1000&sel=a%5Bhref%5D&body=background%3A+%23CFD&ne=1000) (例: `button[data-v-f3f3eg9]`) [クラス-属性 セレクタ](http://stevesouders.com/efws/css-selectors/csscreate.php?n=1000&sel=.class%5Bhref%5D&body=background%3A+%23CFD&ne=1000) (例: `.btn-close[data-v-f3f3eg9]`) よりもかなり遅くなるため、 可能な限りクラスセレクタを優先すべきだということです。
14881488
:::
14891489

14901490
<div class="style-example style-example-bad">
1491-
<h4>Bad</h4>
1491+
<h4>悪い例</h4>
14921492

14931493
```html
14941494
<template>
@@ -1504,7 +1504,7 @@ button {
15041504
</div>
15051505

15061506
<div class="style-example style-example-good">
1507-
<h4>Good</h4>
1507+
<h4>良い例</h4>
15081508

15091509
```html
15101510
<template>
@@ -1519,16 +1519,17 @@ button {
15191519
```
15201520
</div>
15211521

1522-
### Implicit parent-child communication <sup data-p="d">use with caution</sup>
1522+
### 暗黙的な親子間のやりとり <sup data-p="d">注意して使用</sup>
15231523

1524-
**Props and events should be preferred for parent-child component communication, instead of `this.$parent` or mutating props.**
1524+
**親子コンポーネントのやりとりには、 `this.$parent` や プロパティの変更ではなく プロパティとイベントを優先するべきです。**
15251525

1526-
An ideal Vue application is props down, events up. Sticking to this convention makes your components much easier to understand. However, there are edge cases where prop mutation or `this.$parent` can simplify two components that are already deeply coupled.
1526+
理想的な Vue アプリケーションは props down, events up です。 この規則に従うことで、コンポーネントはより理解しやすくなります。しかし、プロパティの変更と `this.$parent` が、すでに深く結合している 2 つのコンポーネントを単純化できるエッジケースも存在します。
15271527

1528-
The problem is, there are also many _simple_ cases where these patterns may offer convenience. Beware: do not be seduced into trading simplicity (being able to understand the flow of your state) for short-term convenience (writing less code).
1528+
問題は、これらのパターンが利便性をもたらす _単純な_ ケースも多くあるということです。
1529+
注意:単純さ(状態の流れを理解できること)と短期的な利便性(より少ないコードを書くこと)の交換に誘惑されないようにしましょう。
15291530

15301531
<div class="style-example style-example-bad">
1531-
<h4>Bad</h4>
1532+
<h4>悪い例</h4>
15321533

15331534
```js
15341535
app.component('TodoItem', {
@@ -1571,7 +1572,7 @@ app.component('TodoItem', {
15711572
</div>
15721573

15731574
<div class="style-example style-example-good">
1574-
<h4>Good</h4>
1575+
<h4>良い例</h4>
15751576

15761577
```js
15771578
app.component('TodoItem', {
@@ -1612,16 +1613,16 @@ app.component('TodoItem', {
16121613
```
16131614
</div>
16141615

1615-
### Non-flux state management <sup data-p="d">use with caution</sup>
1616+
### Flux以外の状態管理 <sup data-p="d">注意して使用</sup>
16161617

1617-
**[Vuex](https://next.vuex.vuejs.org/) should be preferred for global state management, instead of `this.$root` or a global event bus.**
1618+
**グローバルな状態管理には、 `this.$root` やグローバルイベントバスではなく [Vuex](https://next.vuex.vuejs.org/) を優先するべきです。**
16181619

1619-
Managing state on `this.$root` and/or using a global event bus can be convenient for very simple cases, but it is not appropriate for most applications.
1620+
`this.$root` での状態管理やグローバルイベントバスは非常に単純なケースでは便利ですが、ほとんどのアプリケーションには適していません。
16201621

1621-
Vuex is the [official flux-like implementation](/guide/state-management.html#official-flux-like-implementation) for Vue, and offers not only a central place to manage state, but also tools for organizing, tracking, and debugging state changes. It integrates well in the Vue ecosystem (including full [Vue DevTools](/guide/installation.html#vue-devtools) support).
1622+
Vuex は Vue [公式の Flux ライクな実装](/guide/state-management.html#公式の-flux-ライクな実装) で、 状態を管理するための中心的な場所の提供だけでなく、状態の変更を整理、追跡、およびデバッグするためのツールも提供します。 Vuex は、 Vue のエコシステムにうまく統合されています ([Vue DevTools](/guide/installation.html#vue-devtools) の完全なサポートも含みます)。
16221623

16231624
<div class="style-example style-example-bad">
1624-
<h4>Bad</h4>
1625+
<h4>悪い例</h4>
16251626

16261627
```js
16271628
// main.js
@@ -1650,7 +1651,7 @@ const app = createApp({
16501651
</div>
16511652

16521653
<div class="style-example style-example-good">
1653-
<h4>Good</h4>
1654+
<h4>良い例</h4>
16541655

16551656
```js
16561657
// store/modules/todos.js

0 commit comments

Comments
 (0)