From 03283eee6b55688a00aec0d24515370c1b6c8fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=90=E6=B5=A9?= <957869975@qq.com> Date: Wed, 29 May 2019 18:10:57 +0800 Subject: [PATCH] =?UTF-8?q?TreeView=20=E6=96=87=E6=A1=A3=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/components/TreeView.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/docs/components/TreeView.md b/docs/components/TreeView.md index e9528a2..a26a02a 100644 --- a/docs/components/TreeView.md +++ b/docs/components/TreeView.md @@ -3,15 +3,17 @@ 树形结构组件。 ## 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 @@ -19,6 +21,7 @@ import { TreeView } from 'beeshell/dist/components/TreeView'; ![image](../images/TreeView/1.gif) ## Code + [详细 Code](../../examples/TreeView/index.tsx) ```js @@ -57,16 +60,18 @@ const flattenedData = [ console.log(item) }} /> +``` ## API + ### Props -| Name | Type | Required | Default | Description | -| ---- | ---- | ---- | ---- | ---- | -| style | ViewStyle | false | {} | 按钮样式 | -| activeIcon | ReactElement | false | | 激活状态图标 | -| inactiveIcon | ReactElement | false | | 未激活状态图标 | -| data | any[] | false | [] | 数据源,支持嵌套和扁平的树形结构 | -| dataStructureType | string | false | 'nested' | 数据结构类型,支持 'nested' 'flattened' | -| fieldKeys | any | false | {} | 数据项的 key 自定义,包括 idKey pIdKey childrenKey activeKey | -| onPress | Function | false | null | 点击某项回调,参数为点击项 | \ No newline at end of file +| Name | Type | Required | Default | Description | +| ----------------- | ------------ | -------- | --------------------------- | ------------------------------------------------------------ | +| style | ViewStyle | false | {} | 按钮样式 | +| activeIcon | ReactElement | false | | 激活状态图标 | +| inactiveIcon | ReactElement | false | | 未激活状态图标 | +| data | any[] | false | [] | 数据源,支持嵌套和扁平的树形结构 | +| dataStructureType | string | false | 'nested' | 数据结构类型,支持 'nested' 'flattened' | +| fieldKeys | any | false | {} | 数据项的 key 自定义,包括 idKey pIdKey childrenKey activeKey | +| onPress | Function | false | null | 点击某项回调,参数为点击项 |