Skip to content

Commit

Permalink
feat: 调整文档格式
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanbo.lh committed Dec 3, 2024
1 parent 3650243 commit 03bb4e9
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 37 deletions.
2 changes: 1 addition & 1 deletion docs/form-render/advanced-widget.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
order: 4
order: 2
toc: content
mobile: false
group:
Expand Down
6 changes: 3 additions & 3 deletions docs/xflow/XFlowProvider.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
order: 2
title: 'XFlowProvider'
order: 3
title: '多实例画布'
mobile: false
group:
title: 最佳展示
order: 2
order: 4
---

# 基础交互
Expand Down
11 changes: 0 additions & 11 deletions docs/xflow/basic.md

This file was deleted.

25 changes: 11 additions & 14 deletions docs/xflow/custom-flow.md → docs/xflow/custom-node-setting.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
order: 2
title: '自定义组件'
toc: content
mobile: false
group:
title: 最佳展示
order: 2
order: 1
---
# 自定义组件

## 自定义配置组件
# 节点配置面板
节点配置面板支持以下两种渲染方式自定义:

使用`settingWidget`自定义业务配置组件
- **Schema 方式**: 适用于节点配置较为简单的场景。通过 FormRender 配置 schema 来实现快速渲染。
- **Widget 方式**: 针对复杂的配置需求,schema 无法满足时,可以通过自定义组件进行灵活渲染。

<code src="./demo/custom-flow/index.tsx"></code>


## 在schema中自定义组件
## Schema
通过配置节点的 settingSchema 属性,实现节点数据配置项的自定义渲染。

```jsx
import { Input } from 'antd';
Expand Down Expand Up @@ -60,9 +60,6 @@ export default () => {
<XFlow
initialValues={{ nodes, edges }}
settings={settings}
nodeSelector={{
showSearch: true,
}}
widgets={{ customWidget }}
/>
</div>
Expand All @@ -72,7 +69,7 @@ export default () => {

```

## 自定义业务配置信息展示组件
使用`nodeWidget`自定义节点的业务配置信息展示组件,在节点内部展示业务配置信息
## Widget
通过配置节点的 `settingWidget` 属性,实现节点数据配置项的自定义渲染。

<code src="./demo/nodeWidget"></code>
<code src="./demo/custom-flow/index.tsx"></code>
15 changes: 15 additions & 0 deletions docs/xflow/custom-node-view.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
order: 2
toc: content
mobile: false
group:
title: 最佳展示
order: 1
---

# 节点内容展示
当需要额外展示节点内容时,可以通过 `nodeWidget` 进行灵活渲染。

使用`nodeWidget`自定义节点的业务配置信息展示组件,在节点内部展示业务配置信息

<code src="./demo/nodeWidget"></code>
5 changes: 0 additions & 5 deletions docs/xflow/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ npm i @xrenders/xflow --save
*/
import React from 'react';
import XFlow from '@xrenders/xflow';
import schema from './schema/basic';
import data from './data/basic';
import settings from './schema/settings';

export default () => {
Expand Down Expand Up @@ -76,9 +74,6 @@ export default () => {
<XFlow
initialValues={{ nodes, edges }}
settings={settings}
nodeSelector={{
showSearch: true,
}}
/>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions docs/xflow/layout.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
order: 3
title: '布局方向'
order: 1
title: '画布布局'
mobile: false
group:
title: 最佳展示
order: 2
order: 1
---
# 布局方向

Expand Down

0 comments on commit 03bb4e9

Please sign in to comment.