File tree Expand file tree Collapse file tree
packages/components/upload/_example Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,16 +101,18 @@ export default function UploadExample() {
101101 } ;
102102
103103 // eslint-disable-next-line
104- const fileListDisplay = ( ) => (
105- < div >
106- { files3 . map ( ( file , index ) => (
107- < div key = { file . name } className = "t-upload__single-display-text t-upload__display-text--margin" >
108- { file . name } ({ file . size } B)
109- < CloseIcon className = "t-upload__icon-delete" onClick = { ( ) => outsideRemove ( index ) } />
110- </ div >
111- ) ) }
112- </ div >
113- ) ;
104+ const fileListDisplay = ( ) => {
105+ return (
106+ < div >
107+ { files3 . map ( ( file , index ) => (
108+ < div key = { file . name } className = "t-upload__single-display-text t-upload__display-text--margin" >
109+ { file . name } ({ file . size } B)
110+ < CloseIcon className = "t-upload__icon-delete" onClick = { ( ) => outsideRemove ( index ) } />
111+ </ div >
112+ ) ) }
113+ </ div >
114+ ) ;
115+ } ;
114116
115117 // 非自动上传文件,需要在父组件单独执行上传请求
116118 const uploadFiles = ( ) => {
@@ -127,7 +129,11 @@ export default function UploadExample() {
127129 } ;
128130
129131 // 用于格式化接口响应值,error 会被用于上传失败的提示文字;url 表示文件/图片地址
130- const formatResponse : UploadProps [ 'formatResponse' ] = ( res ) => ( { ...res , error : '上传失败,请重试' , url : res ?. url } ) ;
132+ const formatResponse : UploadProps [ 'formatResponse' ] = ( res ) => ( {
133+ ...res ,
134+ error : '上传失败,请重试' ,
135+ url : res ?. url ,
136+ } ) ;
131137
132138 /** 单个文件校验方法,示例代码有效,勿删 */
133139 // const beforeUpload = (file) => {
You can’t perform that action at this time.
0 commit comments