2021-04-19 11:36:28 +08:00
|
|
|
---
|
|
|
|
title: Markdown 渲染
|
|
|
|
description:
|
|
|
|
type: 0
|
|
|
|
group: ⚙ 组件
|
|
|
|
menuName: Markdown 渲染
|
|
|
|
icon:
|
|
|
|
order: 58
|
|
|
|
---
|
|
|
|
|
|
|
|
> 1.1.6 版本开始
|
|
|
|
|
|
|
|
## 基本用法
|
|
|
|
|
|
|
|
```schema
|
|
|
|
{
|
|
|
|
"type": "page",
|
|
|
|
"body": {
|
|
|
|
"type": "markdown",
|
|
|
|
"value": "# title\n markdown **text**"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## 动态数据
|
|
|
|
|
|
|
|
动态数据可以通过 name 来关联,类似 [static](form/static) 组件
|
|
|
|
|
2021-04-22 16:38:26 +08:00
|
|
|
## 基于 Editor 和数据联动来实现预览功能
|
|
|
|
|
|
|
|
```schema: scope="body"
|
|
|
|
{
|
|
|
|
"type": "form",
|
2021-08-09 18:05:01 +08:00
|
|
|
"api": "/api/mock2/form/saveForm",
|
2021-06-07 10:09:55 +08:00
|
|
|
"body": [
|
2021-04-22 16:38:26 +08:00
|
|
|
{
|
|
|
|
"type": "group",
|
2021-06-07 10:09:55 +08:00
|
|
|
"body": [
|
2021-04-22 16:38:26 +08:00
|
|
|
{
|
|
|
|
"type": "editor",
|
|
|
|
"name": "md",
|
|
|
|
"language": "markdown"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "markdown",
|
|
|
|
"name": "md"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2021-09-15 23:22:57 +08:00
|
|
|
## 视频
|
|
|
|
|
|
|
|
可以使用 `![text](video.mp4)` 语法来嵌入视频。
|
|
|
|
|
2021-04-19 11:36:28 +08:00
|
|
|
## 属性表
|
|
|
|
|
|
|
|
| 属性名 | 类型 | 默认值 | 说明 |
|
|
|
|
| --------- | -------- | ------ | ------ |
|
|
|
|
| name | `string` | | 名称 |
|
|
|
|
| value | `string` | | 静态值 |
|
|
|
|
| className | `string` | | 类名 |
|