feat(components): [cascader] add persistent props to cascader to improve performace (#17526)

* feat: add persistent props to cascader to improve performace

* chore: update doc
This commit is contained in:
0song 2024-07-15 21:21:21 +08:00 committed by GitHub
parent d913ba74c8
commit 38a4b0ac8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 1 deletions

View File

@ -162,6 +162,7 @@ cascader/panel
| max-collapse-tags ^(2.3.10) | The max tags number to be shown. To use this, `collpase-tags` must be true | ^[number] | 1 |
| empty-values ^(2.7.0) | empty values of component, [see config-provider](/en-US/component/config-provider#empty-values-configurations) | ^[array] | — |
| value-on-clear ^(2.7.0) | clear return value, [see config-provider](/en-US/component/config-provider#empty-values-configurations) | ^[string] / ^[number] / ^[boolean] / ^[Function] | — |
| persistent ^(2.7.8) | when dropdown is inactive and `persistent` is `false`, dropdown will be destroyed | ^[boolean] | true |
### Cascader Events

View File

@ -110,6 +110,13 @@ export const cascaderProps = buildProps({
type: Boolean,
default: true,
},
/**
* @description when dropdown is inactive and `persistent` is `false`, dropdown will be destroyed
*/
persistent: {
type: Boolean,
default: true,
},
...useEmptyValuesProps,
})

View File

@ -19,7 +19,7 @@
:transition="`${nsCascader.namespace.value}-zoom-in-top`"
effect="light"
pure
persistent
:persistent="persistent"
@hide="hideSuggestionPanel"
>
<template #default>