From 84d331edaef39cdd8304f2dd41c3238b002f525f Mon Sep 17 00:00:00 2001 From: wzc520pyfm <69044080+wzc520pyfm@users.noreply.github.com> Date: Tue, 16 May 2023 09:08:47 +0800 Subject: [PATCH] docs(components): [tree-select] use new display tag (#12663) * docs(components): [tree-select] use new display tag * docs(components): [tree-select] add cache option type --- docs/en-US/component/tree-select.md | 27 +++++++++++++++---- .../tree-select/src/tree-select.vue | 3 +++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/docs/en-US/component/tree-select.md b/docs/en-US/component/tree-select.md index ae77144594..ce0ce0f0d8 100644 --- a/docs/en-US/component/tree-select.md +++ b/docs/en-US/component/tree-select.md @@ -95,7 +95,9 @@ tree-select/lazy ::: -## Attributes +## API + +### Attributes Since this component combines the functions of components `el-tree` and `el-select`, the original properties have not been changed, so no repetition here, @@ -106,8 +108,23 @@ and please go to the original component to view the documentation. | [tree](./tree.md#attributes) | [tree](./tree.md#method) | [tree](./tree.md#events) | [tree](./tree.md#slots) | | [select](./select.md#select-attributes) | [select](./select.md#methods) | [select](./select.md#select-events) | [select](./select.md#select-slots) | -### Own Attributes +#### Own Attributes -| Name | Description | Type | Accepted Values | Default | -| ------------------------- | ------------------------------------------------------------------------------------------------------------------- | ----- | --------------- | ------- | -| cacheData **(\> 2.2.26)** | The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data | array | — | — | +| Name | Description | Type | Default | +| ------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------ | ------- | +| cacheData ^(2.2.26) | The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data | ^[object]`CacheOption[]` | [] | + +## Type Declarations + +
+ Show declarations + +```ts +type CacheOption = { + value: string | number | boolean | object + currentLabel: string | number + isDisabled: boolean +} +``` + +
diff --git a/packages/components/tree-select/src/tree-select.vue b/packages/components/tree-select/src/tree-select.vue index 9e84ad7fff..d236c3c4ed 100644 --- a/packages/components/tree-select/src/tree-select.vue +++ b/packages/components/tree-select/src/tree-select.vue @@ -15,6 +15,9 @@ export default defineComponent({ props: { ...ElSelect.props, ...ElTree.props, + /** + * @description The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data + */ cacheData: { type: Array, default: () => [],