From fbe1d91f89e9a2abe534e7d1ae6b00c210d1ba59 Mon Sep 17 00:00:00 2001 From: liruifengv Date: Wed, 6 Dec 2023 10:22:54 +0800 Subject: [PATCH 01/10] i18n(zh-cn): Update astro-components.mdx --- src/content/docs/zh-cn/core-concepts/astro-components.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/zh-cn/core-concepts/astro-components.mdx b/src/content/docs/zh-cn/core-concepts/astro-components.mdx index 6c9ebc1550475..4daf94db9b98e 100644 --- a/src/content/docs/zh-cn/core-concepts/astro-components.mdx +++ b/src/content/docs/zh-cn/core-concepts/astro-components.mdx @@ -282,7 +282,7 @@ const { title } = Astro.props 插槽可以传递给其他组件。例如,在创建嵌套布局时: -```astro title="src/layouts/BaseLayout.astro" {11,14} +```astro title="src/layouts/BaseLayout.astro" {10,13} --- --- From 4e99803a49a58b90bb397892e6b0338aaf440fcf Mon Sep 17 00:00:00 2001 From: liruifengv Date: Wed, 6 Dec 2023 10:28:41 +0800 Subject: [PATCH 02/10] i18n(zh-cn): Update astro-syntax.mdx --- src/content/docs/zh-cn/core-concepts/astro-syntax.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/zh-cn/core-concepts/astro-syntax.mdx b/src/content/docs/zh-cn/core-concepts/astro-syntax.mdx index a8e73df425246..580456ab097f9 100644 --- a/src/content/docs/zh-cn/core-concepts/astro-syntax.mdx +++ b/src/content/docs/zh-cn/core-concepts/astro-syntax.mdx @@ -6,7 +6,7 @@ i18nReady: true **如果你了解 HTML,那么你已经有能力编写第一个 Astro 组件了。** -Astro 组件语法是 HTML 的超集。这个语法[设计用来让任何有编写 HTML 或 JSX 经验的人感到熟悉](#astro-和-jsx-间的差异) ,并增加了对组件和 JavaScript 表达式的支持。 +Astro 组件语法是 HTML 的超集。这个语法[旨在让任何有编写 HTML 或 JSX 经验的人都感到熟悉](#astro-和-jsx-间的差异) ,并增加了对组件和 JavaScript 表达式的支持。 ## 类 JSX 表达式 @@ -16,7 +16,7 @@ Astro 组件语法是 HTML 的超集。这个语法[设计用来让任何有编 使用这种方法,你可以在 frontmatter 里设置计算的**动态**值。但是一旦设置完,这些值就不是**响应式**的了,也永远不会改变。Astro 组件是在渲染阶段中只运行一次的模板。 -请参阅下面的更多例子[Astro 和 JSX 之间的差异](#astro-和-jsx-间的差异)。 +请参阅下面的更多例子 [Astro 和 JSX 之间的差异](#astro-和-jsx-间的差异)。 ::: ### 变量 From a1933b61d5c82f2eeea4bf1b7e82661c3a4d09f4 Mon Sep 17 00:00:00 2001 From: liruifengv Date: Wed, 6 Dec 2023 10:40:17 +0800 Subject: [PATCH 03/10] i18n(zh-cn): Update framework-components.mdx --- .../docs/zh-cn/core-concepts/framework-components.mdx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/content/docs/zh-cn/core-concepts/framework-components.mdx b/src/content/docs/zh-cn/core-concepts/framework-components.mdx index 0cf81e2bd1a44..11a89991eb391 100644 --- a/src/content/docs/zh-cn/core-concepts/framework-components.mdx +++ b/src/content/docs/zh-cn/core-concepts/framework-components.mdx @@ -197,7 +197,7 @@ import MySvelteButton from '../components/MySvelteButton.svelte'; 这使得你可以用喜欢的 JavaScript 框架中建立整个应用,并通过在 Astro 页面中使用父组件来渲染它们。 :::note -即使 Astro 组件包括激活框架组件,它也会被渲染成静态 HTML。这意味着,你只能传递不做任何 HTML 渲染的参数。在 Astro 组件中向框架组件传递 React 的“渲染参数”是行不通的,因为 Astro 组件无法提供该模式所需要的客户端运行时行为。所以它选择使用命名插槽。 +即使 Astro 组件包括激活框架组件,它也会被渲染成静态 HTML。这意味着,你只能传递不做任何 HTML 渲染的参数。在 Astro 组件中向框架组件传递 React 的“渲染参数”是行不通的,因为 Astro 组件无法提供该模式所需要的客户端运行时行为。所以请改用命名插槽。 ::: ## 我可以在我的框架组件中使用 Astro 组件吗? @@ -223,7 +223,3 @@ import MyAstroComponent from '../components/MyAstroComponent.astro'; [Astro 组件](/zh-cn/core-concepts/astro-components/)是纯 HTML 的模板组件,没有客户端运行时。但是,你可以在 Astro 组件模板中使用 `