Skip to content

Commit ab25ec0

Browse files
authored
Update reactivity-computed-watchers.md
1 parent 3b161ad commit ab25ec0

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` はリアクティブプロパティまたリンクが依存関係として追跡する時にコールされる。
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)