From 63cc86a2cd59d26610c1e5f02c969a4cf534973f Mon Sep 17 00:00:00 2001 From: Jeff <739175122@qq.com> Date: Mon, 11 Nov 2024 15:03:39 +0800 Subject: [PATCH 1/2] docs: Translate 'Omitting parent components' into Chinese --- packages/docs/zh/guide/essentials/nested-routes.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/docs/zh/guide/essentials/nested-routes.md b/packages/docs/zh/guide/essentials/nested-routes.md index 7984ae5e0..3cb3b5aea 100644 --- a/packages/docs/zh/guide/essentials/nested-routes.md +++ b/packages/docs/zh/guide/essentials/nested-routes.md @@ -136,12 +136,11 @@ const routes = [ ] ``` - -## Omitting parent components +## 忽略父组件 -We can also take advantage of the parent-child relationship between routes without needing to nest route components. This can be useful for grouping together routes with a common path prefix, or when working with more advanced features, such as [per-route navigation guards](../advanced/navigation-guards#Per-Route-Guard) or [route meta fields](../advanced/meta). +我们还可以利用路由之间的父子关系,而不需要嵌套路由组件。这对于将具有公共路径前缀的路由分组在一起或使用更高级的功能时很有用,例如: [路由独享的守卫](../advanced/navigation-guards#Per-Route-Guard) 或 [路由元信息](../advanced/meta)。 -To achieve this, we omit the `component` and `components` options from the parent route: +为了实现这一点, 我们可以在父路由中省略了 `component` 和 `components`的选项 ```js const routes = [ @@ -156,4 +155,4 @@ const routes = [ ] ``` -As the parent doesn't specify a route component, the top-level `` will skip over the parent and just use the component from the relevant child instead. +由于父级没有指定路由组件,顶级 `` 将跳过父级并仅使用子级的路由组件。 From 8c4b3878264662d2eae945a9d9f8d48e6c7ff3db Mon Sep 17 00:00:00 2001 From: Jinjiang Date: Thu, 14 Nov 2024 10:54:14 +0800 Subject: [PATCH 2/2] Apply suggestions from code review --- packages/docs/zh/guide/essentials/nested-routes.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/docs/zh/guide/essentials/nested-routes.md b/packages/docs/zh/guide/essentials/nested-routes.md index 3cb3b5aea..4cd61e837 100644 --- a/packages/docs/zh/guide/essentials/nested-routes.md +++ b/packages/docs/zh/guide/essentials/nested-routes.md @@ -138,9 +138,9 @@ const routes = [ ## 忽略父组件 -我们还可以利用路由之间的父子关系,而不需要嵌套路由组件。这对于将具有公共路径前缀的路由分组在一起或使用更高级的功能时很有用,例如: [路由独享的守卫](../advanced/navigation-guards#Per-Route-Guard) 或 [路由元信息](../advanced/meta)。 +我们还可以仅利用路由的父子关系,但不嵌套路由组件。这对于将具有公共路径前缀的路由分组在一起或使用更高级的功能时很有用,例如:[路由独享的守卫](../advanced/navigation-guards#Per-Route-Guard)或[路由元信息](../advanced/meta)。 -为了实现这一点, 我们可以在父路由中省略了 `component` 和 `components`的选项 +为了实现这一点, 我们在父路由中省略了 `component` 和 `components` 选项 ```js const routes = [ @@ -155,4 +155,4 @@ const routes = [ ] ``` -由于父级没有指定路由组件,顶级 `` 将跳过父级并仅使用子级的路由组件。 +由于父级没有指定路由组件,顶级 `` 将跳过父级并仅使用子路由组件。