diff --git a/src/api/options-composition.md b/src/api/options-composition.md index a472a14ff..f91302bab 100644 --- a/src/api/options-composition.md +++ b/src/api/options-composition.md @@ -221,7 +221,7 @@ ``` - 请注意,从 `setup` 返回的 [refs](refs-api.html#ref) 在模板中访问时会自动展开,因此模板中不需要 `.value`。 + 请注意,从 `setup` 返回的 [refs](refs-api.html#ref) 在模板中访问时会自动解包,因此模板中不需要 `.value`。 - **渲染函数/JSX 的方法** diff --git a/src/guide/composition-api-setup.md b/src/guide/composition-api-setup.md index 59e84373f..e29c3eecf 100644 --- a/src/guide/composition-api-setup.md +++ b/src/guide/composition-api-setup.md @@ -92,7 +92,7 @@ export default { } ``` -`attrs` 和 `slots` 是有状态的对象,它们总是会随组件本身的更新而更新。这意味着你应该避免对它们进行解构,并始终以 `attrs.x` 或 `slots.x` 的方式引用 property。请注意,与 `props` 不同,`attrs` 和 ` slots` 是**非**响应式的。如果你打算根据 `attrs` 或 `slots` 更改应用副作用,那么应该在 `onUpdated` 生命周期钩子中执行此操作。 +`attrs` 和 `slots` 是有状态的对象,它们总是会随组件本身的更新而更新。这意味着你应该避免对它们进行解构,并始终以 `attrs.x` 或 `slots.x` 的方式引用 property。请注意,与 `props` 不同,`attrs` 和 `slots` 是**非**响应式的。如果你打算根据 `attrs` 或 `slots` 更改应用副作用,那么应该在 `onUpdated` 生命周期钩子中执行此操作。 ## 访问组件的 property @@ -137,7 +137,7 @@ export default { ``` -注意,从 `setup` 返回的 [refs](../api/refs-api.html#ref) 在模板中访问时是[被自动浅解包](/guide/reactivity-fundamentals.html#ref-展开)的,因此不应在模板中使用 `.value`。 +注意,从 `setup` 返回的 [refs](../api/refs-api.html#ref) 在模板中访问时是[被自动浅解包](/guide/reactivity-fundamentals.html#ref-解包)的,因此不应在模板中使用 `.value`。 ## 使用渲染函数 diff --git a/src/guide/reactivity-fundamentals.md b/src/guide/reactivity-fundamentals.md index 83d325b30..1c544b0d2 100644 --- a/src/guide/reactivity-fundamentals.md +++ b/src/guide/reactivity-fundamentals.md @@ -43,9 +43,9 @@ count.value++ console.log(count.value) // 1 ``` -### Ref 展开 +### Ref 解包 -当 ref 作为渲染上下文 (从 [setup()](composition-api-setup.html) 中返回的对象) 上的 property 返回并可以在模板中被访问时,它将自动浅层次展开内部值。只有访问嵌套的 ref 时需要在模板中添加 `.value`: +当 ref 作为渲染上下文 (从 [setup()](composition-api-setup.html) 中返回的对象) 上的 property 返回并可以在模板中被访问时,它将自动浅层次解包内部值。只有访问嵌套的 ref 时需要在模板中添加 `.value`: ```vue-html