@@ -6,10 +6,10 @@ import EyeOutlined from '@ant-design/icons-vue/EyeOutlined';
6
6
import EyeInvisibleOutlined from '@ant-design/icons-vue/EyeInvisibleOutlined' ;
7
7
import type { InputProps } from './inputProps' ;
8
8
import inputProps from './inputProps' ;
9
- import { computed , defineComponent , shallowRef , watch , watchEffect } from 'vue' ;
9
+ import type { PropType } from 'vue' ;
10
+ import { computed , defineComponent , shallowRef , watchEffect } from 'vue' ;
10
11
import useConfigInject from '../config-provider/hooks/useConfigInject' ;
11
12
import omit from '../_util/omit' ;
12
- import { functionType } from '../_util/type' ;
13
13
14
14
const ActionMap = {
15
15
click : 'onClick' ,
@@ -28,7 +28,7 @@ export default defineComponent({
28
28
action : { type : String , default : 'click' } ,
29
29
visibilityToggle : { type : Boolean , default : true } ,
30
30
visible : { type : Boolean , default : undefined } ,
31
- 'onUpdate:visible' : functionType < ( visible : boolean ) => void > ,
31
+ 'onUpdate:visible' : Function as PropType < ( visible : boolean ) => void > ,
32
32
iconRender : Function ,
33
33
} ,
34
34
setup ( props , { slots, attrs, expose, emit } ) {
@@ -38,10 +38,8 @@ export default defineComponent({
38
38
if ( disabled ) {
39
39
return ;
40
40
}
41
- if ( props . visible === undefined ) {
42
- visible . value = ! visible . value ;
43
- }
44
- emit ( 'update:visible' , ! visible . value ) ;
41
+ visible . value = ! visible . value ;
42
+ emit ( 'update:visible' , visible . value ) ;
45
43
} ;
46
44
watchEffect ( ( ) => {
47
45
if ( props . visible !== undefined ) {
0 commit comments