Skip to content

Commit 3b343de

Browse files
authored
docs(zh): translate the warning part of passing_props to Chinese (#2161)
1 parent 089378b commit 3b343de

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/docs/zh/guide/essentials/passing-props.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,9 @@ URL `/search?q=vue` 将传递 `{query: 'vue'}` 作为 props 传给 `SearchUser`
7979

8080
请尽可能保持 `props` 函数为无状态的,因为它只会在路由发生变化时起作用。如果你需要状态来定义 props,请使用包装组件,这样 vue 才可以对状态变化做出反应。
8181

82-
<!-- TODO: translation -->
82+
## 通过 RouterView
8383

84-
## Via RouterView
85-
86-
You can also pass any props via the [`<RouterView>` slot](../advanced/router-view-slot):
84+
你还可以通过 [`<RouterView>` 插槽](../advanced/router-view-slot) 传递任意参数:
8785

8886
```vue-html
8987
<RouterView v-slot="{ Component }">
@@ -95,5 +93,5 @@ You can also pass any props via the [`<RouterView>` slot](../advanced/router-vie
9593
```
9694

9795
::: warning
98-
In this case, **all view components** will receive `view-prop`. This is usually not a good idea as it means that all of the view components have declared a `view-prop` prop, which is not necessarily true. If possible, use any of the options above.
96+
在这种情况下,**所有视图组件**都会接收到 `view-prop`。通常这并不是一个好主意,因为这意味着所有的视图组件都声明了一个 `view-prop` prop,但这未必需要。所以请尽可能使用上述的其他选项。
9997
:::

0 commit comments

Comments
 (0)