fix(vc-tree-select): `showSearch=false` is invalid #4119 (#4125)

* fix(vc-tree-select): `showSearch=false` is invalid #4119

* style: remove debugger

* style: update

* refactor: update
pull/4171/head
John 2021-06-07 14:22:46 +08:00 committed by GitHub
parent f091582e03
commit b91659e4f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -26,7 +26,6 @@ const TreeSelect = defineComponent({
props: initDefaultProps(TreeSelectProps(), { props: initDefaultProps(TreeSelectProps(), {
transitionName: 'slide-up', transitionName: 'slide-up',
choiceTransitionName: '', choiceTransitionName: '',
showSearch: false,
}), }),
setup() { setup() {
return { return {

View File

@ -21,6 +21,7 @@ const SearchInput = {
needAlign: PropTypes.looseBool, needAlign: PropTypes.looseBool,
ariaId: PropTypes.string, ariaId: PropTypes.string,
isMultiple: PropTypes.looseBool.def(true), isMultiple: PropTypes.looseBool.def(true),
showSearch: PropTypes.looseBool,
}, },
emits: ['mirrorSearchValueChange'], emits: ['mirrorSearchValueChange'],
setup(props, { emit }) { setup(props, { emit }) {
@ -126,6 +127,7 @@ const SearchInput = {
open, open,
ariaId, ariaId,
isMultiple, isMultiple,
showSearch,
} = this.$props; } = this.$props;
const { const {
vcTreeSelect: { onSearchInputKeyDown }, vcTreeSelect: { onSearchInputKeyDown },
@ -146,6 +148,7 @@ const SearchInput = {
onKeydown={onSearchInputKeyDown} onKeydown={onSearchInputKeyDown}
value={searchValue} value={searchValue}
disabled={disabled} disabled={disabled}
readonly={!showSearch}
class={`${prefixCls}-selection-search-input`} class={`${prefixCls}-selection-search-input`}
aria-label="filter select" aria-label="filter select"
aria-autocomplete="list" aria-autocomplete="list"