Skip to content
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

i18n(zh-cn): Update sharing-state.mdx #10563

Merged
merged 2 commits into from
Dec 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/content/docs/zh-cn/recipes/sharing-state.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Steps } from '@astrojs/starlight/components';
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';

:::tip
想使用框架组件?请参考 [共享状态](/zh-cn/recipes/sharing-state-islands/)。
想使用框架组件?请参考 [如何在群岛间共享状态](/zh-cn/recipes/sharing-state-islands/)。
:::

在构建 Astro 网站时,你可能需要在组件之间共享状态。Astro 推荐使用 [Nano Stores](https://github.com/nanostores/nanostores) 来进行客户端的存储共享。
Expand Down Expand Up @@ -59,7 +59,7 @@ import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';
isOpen.set(true);
}

// 为按钮添加一个事件侦听器
// 为按钮添加一个事件监听器
document.getElementById('openDialog').addEventListener('click', openDialog);
</script>
```
Expand All @@ -70,7 +70,7 @@ import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';
<script>
import { isOpen } from '../store.js';

// 侦听状态的修改并相应地显示(或隐藏)对话框
// 监听状态的修改并相应地显示(或隐藏)对话框
isOpen.subscribe(open => {
if (open) {
document.getElementById('dialog').style.display = 'block';
Expand Down
Loading