File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export default class Upload extends SuperComponent {
6767
6868 handleLimit ( customFiles : UploadFile [ ] , max : number ) {
6969 if ( max === 0 ) {
70- max = 20 ;
70+ max = Number . MAX_SAFE_INTEGER ;
7171 }
7272 this . setData ( {
7373 customFiles : customFiles . length > max ? customFiles . slice ( 0 , max ) : customFiles ,
@@ -268,10 +268,10 @@ export default class Upload extends SuperComponent {
268268 } ,
269269
270270 chooseMedia ( mediaType ) {
271- const { config , sizeLimit , customLimit } = this . data ;
272-
271+ const { customLimit } = this . data ;
272+ const { config , sizeLimit } = this . properties ;
273273 wx . chooseMedia ( {
274- count : customLimit ,
274+ count : Math . min ( 20 , customLimit ) ,
275275 mediaType,
276276 ...config ,
277277 success : ( res ) => {
@@ -317,9 +317,10 @@ export default class Upload extends SuperComponent {
317317 } ,
318318
319319 chooseMessageFile ( mediaType ) {
320- const { max, config, sizeLimit } = this . properties ;
320+ const { customLimit } = this . data ;
321+ const { config, sizeLimit } = this . properties ;
321322 wx . chooseMessageFile ( {
322- count : max ,
323+ count : Math . min ( 100 , customLimit ) ,
323324 type : Array . isArray ( mediaType ) ? 'all' : mediaType ,
324325 ...config ,
325326 success : ( res ) => {
You can’t perform that action at this time.
0 commit comments