Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TreeView 文档修正 #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions docs/components/TreeView.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
树形结构组件。

## Usage

### 全部引入

```js
import { TreeView } from 'beeshell';
import { TreeView } from 'beeshell'
```

### 按需引入

```js
import { TreeView } from 'beeshell/dist/components/TreeView';
import { TreeView } from 'beeshell/dist/components/TreeView'
```

## Examples

![image](../images/TreeView/1.gif)

## Code

[详细 Code](../../examples/TreeView/index.tsx)

```js
Expand Down Expand Up @@ -57,16 +60,18 @@ const flattenedData = [
console.log(item)
}}
/>
```

## API

### Props

| Name | Type | Required | Default | Description |
| ---- | ---- | ---- | ---- | ---- |
| style | ViewStyle | false | {} | 按钮样式 |
| activeIcon | ReactElement | false | <Icon type='angle-down' /> | 激活状态图标 |
| inactiveIcon | ReactElement | false | <Icon type='angle-right' /> | 未激活状态图标 |
| data | any[] | false | [] | 数据源,支持嵌套和扁平的树形结构 |
| dataStructureType | string | false | 'nested' | 数据结构类型,支持 'nested' 'flattened' |
| fieldKeys | any | false | {} | 数据项的 key 自定义,包括 idKey pIdKey childrenKey activeKey |
| onPress | Function | false | null | 点击某项回调,参数为点击项 |
| Name | Type | Required | Default | Description |
| ----------------- | ------------ | -------- | --------------------------- | ------------------------------------------------------------ |
| style | ViewStyle | false | {} | 按钮样式 |
| activeIcon | ReactElement | false | <Icon type='angle-down' /> | 激活状态图标 |
| inactiveIcon | ReactElement | false | <Icon type='angle-right' /> | 未激活状态图标 |
| data | any[] | false | [] | 数据源,支持嵌套和扁平的树形结构 |
| dataStructureType | string | false | 'nested' | 数据结构类型,支持 'nested' 'flattened' |
| fieldKeys | any | false | {} | 数据项的 key 自定义,包括 idKey pIdKey childrenKey activeKey |
| onPress | Function | false | null | 点击某项回调,参数为点击项 |