@@ -6,9 +6,10 @@ import getUid from './uid'
66import attrAccept from './attr-accept'
77
88const upLoadPropTypes = {
9- component : PropTypes . string ,
9+ componentTag : PropTypes . string ,
1010 // style: PropTypes.object,
1111 prefixCls : PropTypes . string ,
12+ action : PropTypes . string ,
1213 // className: PropTypes.string,
1314 multiple : PropTypes . bool ,
1415 disabled : PropTypes . bool ,
@@ -163,24 +164,32 @@ const AjaxUploader = {
163164 } ,
164165 render ( ) {
165166 const {
166- component : Tag , prefixCls, disabled, multiple, accept,
167+ componentTag : Tag , prefixCls, disabled, multiple, accept,
167168 } = this . $props
168169 const cls = classNames ( {
169170 [ prefixCls ] : true ,
170171 [ `${ prefixCls } -disabled` ] : disabled ,
171172 } )
172173 const events = disabled ? { } : {
173- onClick : this . onClick ,
174- onKeydown : this . onKeyDown ,
175- onDrop : this . onFileDrop ,
176- onDragover : this . onFileDrop ,
177- tabIndex : '0' ,
174+ click : this . onClick ,
175+ keydown : this . onKeyDown ,
176+ drop : this . onFileDrop ,
177+ dragover : this . onFileDrop ,
178+ }
179+ const tagProps = {
180+ on : {
181+ ...events ,
182+ ...this . $listeners ,
183+ } ,
184+ attrs : {
185+ role : 'button' ,
186+ tabIndex : disabled ? null : '0' ,
187+ } ,
188+ class : cls ,
178189 }
179190 return (
180191 < Tag
181- { ...events }
182- class = { cls }
183- role = 'button'
192+ { ...tagProps }
184193 >
185194 < input
186195 type = 'file'
0 commit comments