Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
光弘 committed Jun 13, 2016
1 parent cb66c79 commit ab44270
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 340 deletions.
9 changes: 0 additions & 9 deletions .editorconfig

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ _site
sea-modules
spm_modules
.cache
.happypack
dist
build
assets/**/*.css
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Thumbs.db
*.swp
out/
.build
.happypack
node_modules
_site
sea-modules
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ see http://uxco.re/components/uploader/ for details.
|className | | | | |
|locale | string | zh-cn | 1.1.10 | 国际化,目前支持 `zh-cn``en-us`|
|fileList | array | [] | 1.2.3 |用于展示的文件列表|
|isOnlyImg | boolean | 是否以图片形式展示 | | |
|core | string/`Core` | null | | 唯一标识或者UploadCore对象, 防止重复创建, 当传入UploadCore对象时,下列参数和事件设置均无效 |
|name | string | 'file' | | 上传文件字段名称 |
|url | string | '' | | 响应上传服务器地址 |
Expand All @@ -53,9 +54,11 @@ see http://uxco.re/components/uploader/ for details.
```javascript
[
{
name: '', // 文件名称,列表形式必填
ext: '', // 文件扩展名。例如 jpg。可选,不填时无法根据类型展示对应图标
fileType: '', // 文件 mimetypes 类型。 例如 image/jpg。 可选,不填时无法根据类型展示对应图标
response: {
url: xxx, // 文件链接,必填
name: xxx, // filename,必填
canRemove: true, // 是否可以删除,可选
downloadUrl: 'xxxx', // 下载 URL,可选
}
Expand All @@ -73,10 +76,10 @@ see http://uxco.re/components/uploader/ for details.
| onfileuploaderror | `File`, `Error` | 文件上传失败 |


### fileList 的格式
### onChange 的 fileList 的枚举格式有如下几种
```javascript
[
// 上传后的文件的格式, responce 即服务器返回的值
// 上传后的文件的格式, response 即服务器返回的值
{
type: 'upload',
ext: file.ext,
Expand Down
183 changes: 0 additions & 183 deletions gulpfile.js

This file was deleted.

120 changes: 52 additions & 68 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,53 @@
{
"name": "uxcore-uploader",
"version": "1.5.3",
"description": "uxcore-uploader component for react",
"main": "build/index.js",
"scripts": {
"start": "npm install && gulp start",
"dev": "npm install && gulp start"
},
"repository": {
"type": "git",
"url": "[email protected]:uxcore/uxcore-uploader.git"
},
"bugs": {
"url": "http://github.com/uxcore/uxcore-uploader/issues"
},
"keywords": [
"react",
"react-component",
"react-uxcore-uploader",
"uxcore-uploader"
],
"devDependencies": {
"babel-core": "~6.4.0",
"babel-loader": "~6.2.1",
"babel-plugin-add-module-exports": "~0.1.2",
"babel-preset-es2015": "^6.3.13",
"babel-preset-es2015-loose": "~7.0.0",
"babel-preset-react": "~6.3.13",
"babel-preset-stage-1": "~6.3.13",
"browser-sync": "~2.11.0",
"colors": "^1.1.2",
"cross-spawn": "^2.1.5",
"css-loader": "^0.13.1",
"es3ify-loader": "~0.1.0",
"es5-shim": "^4.1.10",
"es6-promise": "^2.1.1",
"exports-loader": "^0.6.2",
"gulp": "^3.9.0",
"gulp-babel": "~6.1.1",
"gulp-concat": "~2.6.0",
"gulp-es3ify": "0.0.0",
"gulp-just-replace": "~1.0.2",
"gulp-less": "^3.0.3",
"gulp-sourcemaps": "^1.5.2",
"gulp-util": "^3.0.6",
"highlight.js": "^8.8.0",
"html-wiring": "~1.2.0",
"inquirer": "^0.12.0",
"jquery": "^1.11.3",
"less": "^2.5.0",
"less-loader": "^2.2.0",
"node-libs-browser": "^0.5.2",
"react": "~0.14.0",
"react-dom": "~0.14.0",
"spark-md5": "^1.0.0",
"style-loader": "^0.12.2",
"uxcore-kuma": "~2.0.3",
"webpack": "^1.10.5"
},
"dependencies": {
"object-assign": "^4.0.0",
"uploadcore": "~2.3.0",
"uxcore-progress": "^1.1.0"
},
"author": "onbing",
"contributors": [],
"license": "MIT"
}
"name": "uxcore-uploader",
"version": "1.5.3",
"description": "uxcore-uploader component for react",
"main": "build/index.js",
"scripts": {
"start": "uxcore-tools run start",
"server": "uxcore-tools run server",
"lint": "uxcore-tools run lint",
"build": "uxcore-tools run build",
"test": "uxcore-tools run test",
"coverage": "uxcore-tools run coverage",
"pub": "uxcore-tools run pub",
"dep": "uxcore-tools run dep",
"chrome": "uxcore-tools run chrome",
"browsers": "uxcore-tools run browsers",
"saucelabs": "uxcore-tools run saucelabs"
},
"repository": {
"type": "git",
"url": "[email protected]:uxcore/uxcore-uploader.git"
},
"bugs": {
"url": "http://github.com/uxcore/uxcore-uploader/issues"
},
"keywords": [
"react",
"react-component",
"react-uxcore-uploader",
"uxcore-uploader"
],
"devDependencies": {
"console-polyfill": "^0.2.2",
"es5-shim": "^4.5.8",
"expect.js": "~0.3.1",
"highlight.js": "~9.4.0",
"kuma-base": "1.x",
"react": "15.x",
"react-addons-test-utils": "15.x",
"react-dom": "15.x",
"spark-md5": "~2.0.2",
"uxcore-kuma": "2.x",
"uxcore-tools": "0.2.x"
},
"dependencies": {
"object-assign": "^4.0.0",
"uploadcore": "~2.3.0",
"uxcore-progress": "^1.1.0"
},
"author": "onbing",
"contributors": [],
"license": "MIT"
}
9 changes: 9 additions & 0 deletions tests/Uploader.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import expect from 'expect.js';
import React from 'react';
import ReactDOM from 'react-dom';
import TestUtils, { Simulate } from 'react-addons-test-utils';
import Uploader from '../src';

describe('Uploader', () => {

});
6 changes: 6 additions & 0 deletions tests/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* only require other specs here
*/

const req = require.context('.', false, /\.spec\.js$/);
req.keys().forEach(req);
Loading

0 comments on commit ab44270

Please sign in to comment.