@@ -7,16 +7,16 @@ import { hasProp, getComponent, getOptionProps } from '../_util/props-util';
77import { defaultConfigProvider } from '../config-provider' ;
88import ClearableLabeledInput from './ClearableLabeledInput' ;
99
10- export function fixControlledValue ( value ) {
10+ export function fixControlledValue ( value : string | number ) {
1111 if ( typeof value === 'undefined' || value === null ) {
1212 return '' ;
1313 }
1414 return value ;
1515}
1616
17- export function resolveOnChange ( target , e , onChange ) {
17+ export function resolveOnChange ( target : HTMLInputElement , e : Event , onChange ?: Function ) {
1818 if ( onChange ) {
19- const event = e ;
19+ const event = e as any ;
2020 if ( e . type === 'click' ) {
2121 // click clear icon
2222 //event = Object.create(e);
@@ -40,7 +40,7 @@ export function resolveOnChange(target, e, onChange) {
4040 }
4141}
4242
43- export function getInputClassName ( prefixCls , size , disabled ) {
43+ export function getInputClassName ( prefixCls : string , size : string , disabled : boolean ) {
4444 return classNames ( prefixCls , {
4545 [ `${ prefixCls } -sm` ] : size === 'small' ,
4646 [ `${ prefixCls } -lg` ] : size === 'large' ,
@@ -91,12 +91,12 @@ export default defineComponent({
9191 }
9292 } ,
9393 methods : {
94- handleInputFocus ( e ) {
94+ handleInputFocus ( e : Event ) {
9595 this . isFocused = true ;
9696 this . onFocus && this . onFocus ( e ) ;
9797 } ,
9898
99- handleInputBlur ( e ) {
99+ handleInputBlur ( e : Event ) {
100100 this . isFocused = false ;
101101 this . onBlur && this . onBlur ( e ) ;
102102 } ,
@@ -112,15 +112,15 @@ export default defineComponent({
112112 this . input . select ( ) ;
113113 } ,
114114
115- saveClearableInput ( input : any ) {
115+ saveClearableInput ( input : HTMLInputElement ) {
116116 this . clearableInput = input ;
117117 } ,
118118
119- saveInput ( input : any ) {
119+ saveInput ( input : HTMLInputElement ) {
120120 this . input = input ;
121121 } ,
122122
123- setValue ( value : any , callback ?: Function ) {
123+ setValue ( value : string | number , callback ?: Function ) {
124124 if ( this . stateValue === value ) {
125125 return ;
126126 }
@@ -134,7 +134,7 @@ export default defineComponent({
134134 } ) ;
135135 } ,
136136 triggerChange ( e : Event ) {
137- this . $emit ( 'update:value' , ( e . target as any ) . value ) ;
137+ this . $emit ( 'update:value' , ( e . target as HTMLInputElement ) . value ) ;
138138 this . $emit ( 'change' , e ) ;
139139 this . $emit ( 'input' , e ) ;
140140 } ,
0 commit comments