Skip to content

Commit

Permalink
💚 docs: 更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jun 3, 2021
1 parent 5314c9f commit 1a4ca47
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
32 changes: 2 additions & 30 deletions docs/components/biz/examples/Mindflow/Demo.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,10 @@
import React, { useState } from 'react';
import { Radio } from 'antd';
import { devtools } from 'stook-devtools';
import React from 'react';

import Mindflow from '@arvinxu/mindflow';
import * as datasource from './data';

// @ts-ignore
if (process.env.NODE_ENV !== 'production') {
devtools.init();
}

const { Group } = Radio;

const MindflowDemo = () => {
const [type, setType] = useState<'demo' | 'museum' | 'thinking'>('thinking');

return (
<div>
<div style={{ marginBottom: 16 }}>
<span style={{ marginRight: 8 }}>切换案例数据:</span>
<Group
value={type}
onChange={(e) => {
setType(e.target.value);
}}
>
<Radio value={'demo'}>demo</Radio>
<Radio value={'museum'}>博物馆案例</Radio>
<Radio value={'thinking'}>思考案例</Radio>
</Group>
</div>
<Mindflow data={datasource[type]} height={600} />
</div>
);
return <Mindflow value={datasource.demo} height={600} />;
};

export default MindflowDemo;
9 changes: 9 additions & 0 deletions docs/components/biz/examples/Mindflow/Museum.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import Mindflow from '@arvinxu/mindflow';
import * as datasource from './data';

const Museum = () => {
return <Mindflow value={datasource.museum} height={600} />;
};

export default Museum;
10 changes: 10 additions & 0 deletions docs/components/biz/examples/Mindflow/Thinking.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import Mindflow from '@arvinxu/mindflow';

import * as datasource from './data';

const Thinking = () => {
return <Mindflow value={datasource.thinking} height={600} />;
};

export default Thinking;
15 changes: 12 additions & 3 deletions docs/components/biz/mindflow.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: Mindflow
title: Mindflow 思流
order: 1
group:
title: 业务组件
---

# Mindflow
# Mindflow 思流

[![NPM version][version-image]][version-url] [![NPM downloads][download-image]][download-url]

Expand All @@ -29,7 +29,16 @@ Mindflow 是基于 [溯因推理][reason] 与 [图尔敏推论模型][toulmin]

## 演示

PS: 暂不支持多实例
### 基本 Demo

<code src='./examples/Mindflow/Demo.tsx' />

### 博物馆案例

<code src='./examples/Mindflow/Museum.tsx' />

### 思维结构

<code src='./examples/Mindflow/Thinking.tsx' />

<API src='../../../packages/mindflow/src/index.tsx'></API>

0 comments on commit 1a4ca47

Please sign in to comment.