Skip to content

Commit

Permalink
fix: showClear
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Jul 1, 2024
1 parent 38aa360 commit 5b38506
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export default defineComponent({
},
]);
const showClear = computed(() => {
if (isDisabled.value || props.readonly === true) return false;

if (props.clearable && innerValue.value && innerValue.value.length > 0) {
return props.clearTrigger === 'always' || (props.clearTrigger === 'focus' && focused.value);
}
Expand Down

0 comments on commit 5b38506

Please sign in to comment.