slidev-addon-infographic
v1.1.0
Published
@antv/infographic component for slidev
Maintainers
Readme
slidev-addon-infographic
@antv/infographic component for slidev

Usage Process
pnpm i slidev-addon-infographic --saveAdd the following to your package.json:
...
"slidev": {
"addons": [
"slidev-addon-infographic"
]
}
...Add the following to your slides.md:
v1.1.0+
Starting from v1.1.0, the InfographicBox component has been added (which internally includes the RenderWhen component) for displaying infographics in slides.
从 v1.1.0 开始,新增了 InfographicBox 组件(内部包含 RenderWhen 组件),用于在幻灯片中显示信息图。
---
addons:
- slidev-addon-infographic
---
<InfographicBox
:data="`infographic list-row-simple-horizontal-arrow
data
items
- label 步骤 1
desc 开始
- label 步骤 2
desc 进行中
- label 步骤 3
desc 完成
`"></InfographicBox>- To export in PDF format, add the
isExportPdfproperty to theInfographicBoxcomponent. When exporting,clickwill be set tofalseby default.
- 如需导出 PDF 格式,请为
InfographicBox组件增加isExportPdf属性,导出的时候会默认将click设置为false。
v1.0.0+
---
addons:
- slidev-addon-infographic
---
<RenderWhen
:context="['visible', 'print', 'slide', 'overview', 'presenter', 'previewNext']"
style="height: 100%;">
<Infographic
:data="`infographic list-row-simple-horizontal-arrow
data
items
- label 步骤 1
desc 开始
- label 步骤 2
desc 进行中
- label 步骤 3
desc 完成
`"></Infographic>
</RenderWhen>- Infographic component must be used with RenderWhen component to show infographic in slidev.
- If you want to export PDF format, please remove
visibleinRenderWhencomponent'scontextattribute.
- Infographic组件必须与RenderWhen组件一起使用,才能在幻灯片中显示信息图。
- 如需导出 PDF 格式,请将
RenderWhen组件的context属性中的visible去除。
Parameter Description
| Parameter | Description | Type | Default | Version |
| --------- | ----------- | ---- | ------- | ------- |
| data | Infographic data | string | - | 1.0.0 |
| click | Whether to respond to Slidev click animation, If set to true, you need to add a clicks field in the frontmatter with the value being the number of clicks. | boolean | false | 1.0.4 |
| isExportPdf | Whether to export in PDF format. When exporting, click will be set to false by default. | boolean | false | 1.1.0 |
- Note:
clickis primarily used for demonstrating effects, and it is recommended to turn it off when exporting. - Note: When
clickistrue, it needs to occupy a separate page. - Note: After setting
clicktotrueand adding theclickscount, you need to click yourself to confirm the effect.
| 参数 | 描述 | 类型 | 默认值 | 版本 |
| ---- | ---- | ---- | ------ | ---- |
| data | 信息图数据 | string | - | 1.0.0 |
| click | 是否响应Slidev点击动画,如果设置为 true,需要在 frontmatter 中添加 clicks 字段,值为点击次数。 | boolean | false | 1.0.4 |
| isExportPdf | 是否导出 PDF 格式。导出时会默认将 click 设置为 false。 | boolean | false | 1.1.0 |
- 注意:
click主要用于演示效果,导出时建议关闭。 - 注意:
click为true时,需要单独占一页。 - 注意:设置
click为true后,并添加clicks点击次数之后的效果需要自行点击确认。
Example
Slidev
Edit the slides.md to see the changes.
Learn more about Slidev at the documentation.
