@@ -7,16 +7,16 @@ import { hasProp, getComponent, getOptionProps } from '../_util/props-util';
7
7
import { defaultConfigProvider } from '../config-provider' ;
8
8
import ClearableLabeledInput from './ClearableLabeledInput' ;
9
9
10
- export function fixControlledValue ( value ) {
10
+ export function fixControlledValue ( value : string | number ) {
11
11
if ( typeof value === 'undefined' || value === null ) {
12
12
return '' ;
13
13
}
14
14
return value ;
15
15
}
16
16
17
- export function resolveOnChange ( target , e , onChange ) {
17
+ export function resolveOnChange ( target : HTMLInputElement , e : Event , onChange ?: Function ) {
18
18
if ( onChange ) {
19
- const event = e ;
19
+ const event = e as any ;
20
20
if ( e . type === 'click' ) {
21
21
// click clear icon
22
22
//event = Object.create(e);
@@ -40,7 +40,7 @@ export function resolveOnChange(target, e, onChange) {
40
40
}
41
41
}
42
42
43
- export function getInputClassName ( prefixCls , size , disabled ) {
43
+ export function getInputClassName ( prefixCls : string , size : string , disabled : boolean ) {
44
44
return classNames ( prefixCls , {
45
45
[ `${ prefixCls } -sm` ] : size === 'small' ,
46
46
[ `${ prefixCls } -lg` ] : size === 'large' ,
@@ -91,12 +91,12 @@ export default defineComponent({
91
91
}
92
92
} ,
93
93
methods : {
94
- handleInputFocus ( e ) {
94
+ handleInputFocus ( e : Event ) {
95
95
this . isFocused = true ;
96
96
this . onFocus && this . onFocus ( e ) ;
97
97
} ,
98
98
99
- handleInputBlur ( e ) {
99
+ handleInputBlur ( e : Event ) {
100
100
this . isFocused = false ;
101
101
this . onBlur && this . onBlur ( e ) ;
102
102
} ,
@@ -112,15 +112,15 @@ export default defineComponent({
112
112
this . input . select ( ) ;
113
113
} ,
114
114
115
- saveClearableInput ( input : any ) {
115
+ saveClearableInput ( input : HTMLInputElement ) {
116
116
this . clearableInput = input ;
117
117
} ,
118
118
119
- saveInput ( input : any ) {
119
+ saveInput ( input : HTMLInputElement ) {
120
120
this . input = input ;
121
121
} ,
122
122
123
- setValue ( value : any , callback ?: Function ) {
123
+ setValue ( value : string | number , callback ?: Function ) {
124
124
if ( this . stateValue === value ) {
125
125
return ;
126
126
}
@@ -134,7 +134,7 @@ export default defineComponent({
134
134
} ) ;
135
135
} ,
136
136
triggerChange ( e : Event ) {
137
- this . $emit ( 'update:value' , ( e . target as any ) . value ) ;
137
+ this . $emit ( 'update:value' , ( e . target as HTMLInputElement ) . value ) ;
138
138
this . $emit ( 'change' , e ) ;
139
139
this . $emit ( 'input' , e ) ;
140
140
} ,
0 commit comments