Skip to content

Commit

Permalink
fix(select): 修复 creatable 模式下的 filter 能力
Browse files Browse the repository at this point in the history
  • Loading branch information
kristli committed Aug 31, 2022
1 parent 7bf78fa commit 8fcb099
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/select/select-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default defineComponent({
const showCreateOption = computed(() => props.creatable && props.filterable && props.inputValue);

const displayOptions = computed(() => {
if (!props.inputValue || props.creatable || !(props.filterable || isFunction(props.filter))) return props.options;
if (!props.inputValue || !(props.filterable || isFunction(props.filter))) return props.options;

const filterMethods = (option: SelectOption) => {
if (isFunction(props.filter)) {
Expand Down Expand Up @@ -160,6 +160,7 @@ export default defineComponent({
{/* 空状态 */}
{!props.loading &&
isEmpty.value &&
!showCreateOption.value &&
renderDefaultTNode('empty', {
defaultNode: <div class={`${COMPONENT_NAME.value}__empty`}>{t(globalConfig.value.empty)}</div>,
})}
Expand Down

0 comments on commit 8fcb099

Please sign in to comment.