{"size": 686, "ext": "js", "max_stars_repo_path": "tinper-bee/bee-upload/demo/demolist/Demo6.js", "max_stars_repo_name": "JetXing/mtl-api", "max_stars_repo_stars_event_min_datetime": "2022-03-07T03:45:02.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-07T03:45:02.000Z", "max_issues_repo_path": "tinper-bee/bee-upload/demo/demolist/Demo6.js", "max_issues_repo_name": "JetXing/mtl-tools", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "tinper-bee/bee-upload/demo/demolist/Demo6.js", "max_forks_repo_name": "JetXing/mtl-tools", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.1764705882, "max_line_length": 90, "alphanum_fraction": 0.6253644315}
/**
 * @title 限制文件类型
 * @description 自定义上传文件的类型。关键参数accept:image/* 所有图片格式  accept:image/png,image/gif  限制个别文件类型
 */

import React, { Component } from 'react';
import Icon from 'bee-icon';
import Button from 'bee-button';
import Upload from '../../src';

const demo6props = {
  name: 'file',
  action: '/upload.do',
  accept:"image/*",
  // accept:"image/png,image/gif", //限制个别图片类型
  size:300,
  headers: {
    authorization: 'authorization-text',
  }
};

class Demo6 extends Component {
	render(){
		return( 
			<Upload {...demo6props}>
        <Button shape="border">
          <Icon type="uf-upload" /> Click to Upload
        </Button>
      </Upload>
		)
	}
}

export default Demo6;