From 1aba8227e7ab2de328f54f56aad094ade1be0979 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 17 Aug 2021 19:32:51 +0800 Subject: [PATCH] docs(TreeSelect): improve document (#9274) --- src/tree-select/README.md | 14 +++++++------- src/tree-select/README.zh-CN.md | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/tree-select/README.md b/src/tree-select/README.md index 5eff60f63..676da3ed7 100644 --- a/src/tree-select/README.md +++ b/src/tree-select/README.md @@ -174,7 +174,7 @@ export default { | Attribute | Description | Type | Default | | --- | --- | --- | --- | -| items | Required datasets for the component | _Item[]_ | `[]` | +| items | Required datasets for the component | _TreeSelectItem[]_ | `[]` | | height | Height | _number \| string_ | `300` | | main-active-index | The index of selected parent node | _number \| string_ | `0` | | active-id | Id of selected item | _number \| string \|
(number \| string)[]_ | `0` | @@ -183,10 +183,10 @@ export default { ### Events -| Event | Description | Arguments | -| --- | --- | --- | -| click-nav | Emitted when parent node is selected | index: index of selected parent | -| click-item | Emitted when item is selected | data: selected item | +| Event | Description | Arguments | +| ---------- | ------------------------------------ | ----------------------- | +| click-nav | Emitted when parent node is selected | _index: number_ | +| click-item | Emitted when item is selected | _item: TreeSelectChild_ | ### Slots @@ -194,9 +194,9 @@ export default { | ------- | -------------------- | | content | Custom right content | -### Data Structure of Item +### Data Structure of TreeSelectItem -`items` should be an array contains specified tree objects. +`TreeSelectItem` should be an array contains specified tree objects. In every tree object, `text` property defines `id` stands for the unique key while the `children` contains sub-tree objects. diff --git a/src/tree-select/README.zh-CN.md b/src/tree-select/README.zh-CN.md index 5283ba3a4..8a7154d8b 100644 --- a/src/tree-select/README.zh-CN.md +++ b/src/tree-select/README.zh-CN.md @@ -182,7 +182,7 @@ export default { | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | -| items | 分类显示所需的数据 | _Item[]_ | `[]` | +| items | 分类显示所需的数据 | _TreeSelectItem[]_ | `[]` | | height | 高度,默认单位为`px` | _number \| string_ | `300` | | main-active-index | 左侧选中项的索引 | _number \| string_ | `0` | | active-id | 右侧选中项的 id,支持传入数组 | _number \| string \|
(number \| string)[]_ | `0` | @@ -191,10 +191,10 @@ export default { ### Events -| 事件名 | 说明 | 回调参数 | -| ---------- | -------------------- | ------------------------- | -| click-nav | 点击左侧导航时触发 | index:被点击的导航的索引 | -| click-item | 点击右侧选择项时触发 | data: 该点击项的数据 | +| 事件名 | 说明 | 回调参数 | +| ---------- | -------------------- | ----------------------- | +| click-nav | 点击左侧导航时触发 | _index: number_ | +| click-item | 点击右侧选择项时触发 | _item: TreeSelectChild_ | ### Slots @@ -202,9 +202,9 @@ export default { | ------- | ------------------ | | content | 自定义右侧区域内容 | -### Item 数据结构 +### TreeSelectItem 数据结构 -`items` 整体为一个数组,数组内包含一系列描述分类的对象,每个分类里,`text`表示当前分类的名称,`children`表示分类里的可选项。 +`TreeSelectItem` 整体为一个数组,数组内包含一系列描述分类的对象,每个分类里,`text` 表示当前分类的名称,`children` 表示分类里的可选项。 ```js [