Skip to content

Commit

Permalink
docs: fix translations in builtin/components (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
wemsx authored Feb 1, 2025
1 parent bf17c10 commit 657fd13
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
39 changes: 20 additions & 19 deletions builtin/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- `y2` (`string | number`, 必要值): 终点 y 位置
- `width` (`string | number`, 默认为: `2`): 线宽
- `color` (`string`, 默认为: `'currentColor'`): 颜色
- `two-way` (`boolean`, default: `false`): draw a two-way arrow
- `two-way` (`boolean`, 默认为: `false`): 是否为双向箭头

## `VDragArrow`

Expand Down Expand Up @@ -60,16 +60,16 @@

## `LightOrDark`

你可以使用它来根据活动的亮色或暗色主题,显示一种或另一种内容
你可以使用它来根据当前的主题色(亮色或暗色),显示不同的内容

### 用法 {#light-or-dark-使用方式}

`#dark``#light` 插槽一起使用:

```md
<LightOrDark>
<template #dark>Dark mode is on</template>
<template #light>Light mode is on</template>
<template #dark>正在使用暗色主题</template>
<template #light>正在使用亮色主题</template>
</LightOrDark>
```

Expand Down Expand Up @@ -110,7 +110,7 @@
### 使用方式

```md
<Link to="42">Go to slide 42</Link>
<Link to="42">跳转到第 42 张 slide</Link>
<Link to="42" title="Go to slide 42"/>
<Link to="solutions" title="Go to solutions"/>
```
Expand All @@ -127,12 +127,13 @@
routeAlias: solutions
---

# Now some solutions!
# 现在来些解决方案!
```

## `PoweredBySlidev`

Renders "Powered by Slidev" with a link to the Slidev website.
添加一个带有指向 slidev 网站的 “Powered by Slidev” 标志到幻灯片信息中。
你可以在导航栏中点击<carbon-information class="inline-icon-btn"/>来查看

## `RenderWhen`

Expand All @@ -141,12 +142,12 @@ Renders "Powered by Slidev" with a link to the Slidev website.
### 使用方式

```md
<RenderWhen context="presenter">This will only be rendered in presenter view.</RenderWhen>
<RenderWhen context="presenter">这只会在演讲者视图中显示。</RenderWhen>
```

Context type: `'main' | 'visible' | 'print' | 'slide' | 'overview' | 'presenter' | 'previewNext'`
context 的类型: `'main' | 'visible' | 'print' | 'slide' | 'overview' | 'presenter' | 'previewNext'`

Props:
尝试:

- `context` (`Context | Context[]`): 要求的渲染上下文或渲染上下文数组
- `'main'`: 在幻灯片和演示者视图中渲染(相当于 ['slide', 'presenter']),
Expand All @@ -157,10 +158,10 @@ Props:
- `'presenter'`: 在演示者视图中渲染
- `'previewNext'`: 在演示者的下一张幻灯片视图中渲染

Slots:
插槽:

- `#default`: Rendered when the context matches
- `#fallback`: Rendered when the context does not match
- `#default`: context 符合时显示
- `#fallback`: context 不符合时显示

## `SlideCurrentNo`

Expand Down Expand Up @@ -192,7 +193,7 @@ Slots:

```yml
---
title: Amazing slide title
title: 一个令人惊叹的标题
level: 2
---
```
Expand All @@ -211,7 +212,7 @@ import TitleRenderer from '#slidev/title-renderer'
<TitleRenderer no="42" />
```

Props:
参数:

- `no` (`string | number`): 显示标题的幻灯片编号(幻灯片从 `1` 开始)

Expand Down Expand Up @@ -259,7 +260,7 @@ hideInToc: true
</Transform>
```

Props:
参数:

- `scale` (`number | string`, 默认为 `1`): 大小比例
- `origin` (`string`, 默认为 `'top left'`): 原点位置
Expand All @@ -274,7 +275,7 @@ Props:
<Tweet id="20" />
```

Props:
参数:

- `id` (`number | string`, 必要值): 推文 id
- `scale` (`number | string`, 默认为: `1`): 大小比例
Expand Down Expand Up @@ -307,7 +308,7 @@ Props:

```md
<SlidevVideo v-click autoplay controls>
<!-- Anything that can go in an HTML video element. -->
<!-- 可以加入 HTML video 元素中能包含的任何内容。 -->
<source src="/myMovie.mp4" type="video/mp4" />
<source src="/myMovie.webm" type="video/webm" />
<p>
Expand All @@ -320,7 +321,7 @@ Props:

查阅 [HTML video 元素文档](https://developer.mozilla.org/docs/Web/HTML/Element/Video) 以了解可以包含在此组件插槽中的内容。

Props:
参数:

- `controls` (`boolean`, 默认为 `false`): 显示视频控件
- `autoplay` (`boolean | 'once'`, 默认为 `false`):
Expand Down
8 changes: 4 additions & 4 deletions guide/exporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,17 @@ $ slidev export --executable-path [path_to_chromium]
$ slidev export --with-toc
```

### Omit Background
### 去除背景

When exporting to PNGs, you can remove the default browser background by passing `--omit-background`:
在导出为 PNG图像时,你可以通过传递 `--omit-background` 选项去除默认的浏览器背景:

```bash
$ slidev export --omit-background
```

The default browser background is the white background visible on all browser windows and is different than other backgrounds applied throughout the application using CSS styling. [See Playwright docs](https://playwright.dev/docs/api/class-page#page-screenshot-option-omit-background). You will then need to apply additional CSS styling to the application to reveal the transparency.
默认浏览器背景是所有浏览器窗口上可见的白色背景。它与在整个应用中使用CSS样式呈现的其他背景不同。请参阅 [Playwright 的文档](https://playwright.dev/docs/api/class-page#page-screenshot-option-omit-background)。此外,你需要应用额外的CSS样式以显示透明度。

Here is a basic example that covers all backgrounds in the application:
以下是一个示例,覆盖了应用中的所有背景:

```css
* {
Expand Down

0 comments on commit 657fd13

Please sign in to comment.