-
Notifications
You must be signed in to change notification settings - Fork 87
API Reference > Refs の翻訳 #545
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
Conversation
✔️ Deploy Preview for vuejs-v3-ja-doc-preview ready! 🔨 Explore the source changes: a24df84 🔍 Inspect the deploy log: https://app.netlify.com/sites/vuejs-v3-ja-doc-preview/deploys/617bf1f4ad4edc00088c9923 😎 Browse the preview: https://deploy-preview-545--vuejs-v3-ja-doc-preview.netlify.app |
@@ -28,15 +28,15 @@ interface Ref<T> { | |||
function ref<T>(value: T): Ref<T> | |||
``` | |||
|
|||
Sometimes we may need to specify complex types for a ref's inner value. We can do that succinctly by passing a generics argument when calling `ref` to override the default inference: | |||
場合によっては、ref の内部値に複合の型を指定する必要があります。そのような場合には、`ref` を呼び出す際にジェネリクス引数を渡して、デフォルトの推論をオーバーライドすることで、簡潔に指定できます。 |
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.
以下は、読んでいて原文への違和感。(独り言
Generics っていうキーワードが出てきているけど、TypeScript 知っていることを前提にかかれているのかな。 🤔
src/api/refs-api.md
Outdated
@@ -47,17 +47,17 @@ function useState<State extends string>(initial: State) { | |||
|
|||
## `unref` | |||
|
|||
Returns the inner value if the argument is a [`ref`](#ref), otherwise return the argument itself. This is a sugar function for `val = isRef(val) ? val.value : val`. | |||
引数が [`ref`](#ref) の場合はその内部の値を、そうでない場合は引数そのものを返します。これは、`val = isRef(val) ? val.value : val` のシュガー関数です。 |
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.
sugar ですが、プログラミングの文脈ではよく使う言葉なので�その辺に精通している人は、シュガー
という訳だけで分かるかと思います。ただ、front-end の領域は、それほとプログラミングに精通しているいない人が使うことがあるので、ここで注釈も加えて訳にしておいた方がいいです。
sugar
は文脈的に、簡略的なことを意味していると思うので、シュガー(簡易)
とかどうでしょうか。
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.
「syntax sugar」のシュガーと言われればピンときますが、単体で言われると補足必要ですね 🤔
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.
レビュー 👀 コメント 💬 しました!
確認お願いします! 🙏
src/api/refs-api.md
Outdated
@@ -74,7 +74,7 @@ state.foo++ | |||
console.log(fooRef.value) // 3 | |||
``` | |||
|
|||
`toRef` is useful when you want to pass the ref of a prop to a composition function: | |||
`toRef` は、prop の ref をコンポジション関数に渡したいときに便利です: |
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.
composition function
の composition
は日本語訳の方では、Composition API
をそのままな形にしてきているので、一貫性を保ちたいです。(そもそも個人的には原文の方は、composable function
にしたい 😅 )composition (構成:
src/api/refs-api.md
Outdated
state.foo++ | ||
console.log(stateAsRefs.foo.value) // 2 | ||
|
||
stateAsRefs.foo.value++ | ||
console.log(state.foo) // 3 | ||
``` | ||
|
||
`toRefs` is useful when returning a reactive object from a composition function so that the consuming component can destructure/spread the returned object without losing reactivity: | ||
`toRefs` は、コンポジション関数からリアクティブなオブジェクトを返すときに便利で、利用する側のコンポーネントはリアクティビティを失うことなく、返されたオブジェクトを分割代入できます: |
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.
ここの compostion function
の同じく
# Conflicts: # src/api/reactivity-api.md
修正しました。ご確認よろしくお願いします:pray: |
@jay-es |
Description of Problem
API Reference > Refs を翻訳しました
原文ページ:
https://v3.vuejs.org/api/refs-api.html
Proposed Solution
Additional Information