Skip to content

Commit cc99d8f

Browse files
ZiF1Rkazupon
andauthored
Fix untranslated part of reactivity-computed-watchers article (#597)
* Update reactivity-computed-watchers.md * Update reactivity-computed-watchers.md * Update reactivity-computed-watchers.md * Apply suggestions from code review Co-authored-by: kazuya kawaguchi <kawakazu80@gmail.com> Co-authored-by: kazuya kawaguchi <kawakazu80@gmail.com>
1 parent 9f3e2f6 commit cc99d8f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/guide/reactivity-computed-watchers.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,35 +30,35 @@ plusOne.value = 1
3030
console.log(count.value) // 0
3131
```
3232

33-
### Computed Debugging <Badge text="3.2+" />
33+
### 算出プロパティのデバッグ <Badge text="3.2+" />
3434

35-
`computed` accepts a second argument with `onTrack` and `onTrigger` options:
35+
`computed` は 2 つ目の引数及び `onTrack` `onTrigger` オプションにアクセスする:
3636

37-
- `onTrack` will be called when a reactive property or ref is tracked as a dependency.
38-
- `onTrigger` will be called when the watcher callback is triggered by the mutation of a dependency.
37+
- `onTrack` はリアクティブプロパティまた ref が依存関係として追跡する時に呼び出される。
38+
- `onTrigger` はウォッチャのコールバックが依存関係の変更上でトリガーされた時に呼び出される。
3939

40-
Both callbacks will receive a debugger event which contains information on the dependency in question. It is recommended to place a `debugger` statement in these callbacks to interactively inspect the dependency:
40+
両方のコールバックは依存情報を持つデバッグイベントを受け取ります。このコールバックにはインタラクティブに依存を確認ため `debugger` と言う表現を使う推奨します:
4141

4242
```js
4343
const plusOne = computed(() => count.value + 1, {
4444
onTrack(e) {
45-
// triggered when count.value is tracked as a dependency
45+
// count.value を依存関係として追跡する場合にトリガーする
4646
debugger
4747
},
4848
onTrigger(e) {
49-
// triggered when count.value is mutated
49+
// count.value を変更される場合にトリガーする
5050
debugger
5151
}
5252
})
5353

54-
// access plusOne, should trigger onTrack
54+
// plusOne にアクセスされる場合に onTrack がトリガーする
5555
console.log(plusOne.value)
5656

57-
// mutate count.value, should trigger onTrigger
57+
// count.value を変更される場合に onTrigger がトリガーする
5858
count.value++
5959
```
6060

61-
`onTrack` and `onTrigger` only work in development mode.
61+
`onTrack` `onTrigger` は開発モードのみに動作します。
6262

6363
## `watchEffect`
6464

0 commit comments

Comments
 (0)