File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/devui-vue/devui/input/src Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,9 @@ export default defineComponent({
4040 const suffixVisible = ctx . slots . suffix || props . suffix || props . showPassword || props . clearable ;
4141
4242 const showPwdVisible = computed ( ( ) => props . showPassword && ! inputDisabled . value ) ;
43- const showClearable = computed ( ( ) => props . clearable && ! inputDisabled . value ) ;
43+ const showClearable = computed ( ( ) => {
44+ return props . clearable && ! inputDisabled . value && modelValue . value ?. length > 0 ;
45+ } ) ;
4446
4547 watch (
4648 ( ) => props . modelValue ,
@@ -89,7 +91,7 @@ export default defineComponent({
8991 onClick = { clickPasswordIcon }
9092 />
9193 ) }
92- { showClearable . value && modelValue . value . length > 0 && (
94+ { showClearable . value && (
9395 < Icon size = { inputSize . value } class = { ns . em ( 'clear' , 'icon' ) } name = "close" onClick = { onClear } />
9496 ) }
9597 </ span >
You can’t perform that action at this time.
0 commit comments