Skip to content

Commit 0d8f07e

Browse files
author
levy
committed
docs: update
1 parent 4775fcf commit 0d8f07e

File tree

2 files changed

+66
-66
lines changed

2 files changed

+66
-66
lines changed

README-en.md renamed to README-zh.md

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/FEMessage/upload-to-ali/pulls)
88
[![Automated Release Notes by gren](https://img.shields.io/badge/%F0%9F%A4%96-release%20notes-00B2EE.svg)](https://github-tools.github.io/github-release-notes/)
99

10-
This component can upload file to Aliyun-OSS easily.
11-
12-
You can configure OSS information through environmental variables, customize domain, support multi-selection, limit file size, delete, paste to upload, drag and drop to upload, make files upload simpler.
10+
对接阿里云-OSS,可通过环境变量配置 OSS 信息,可自定义域名,支持多选、限制文件大小、删除、粘贴上传功能,拖拽上传功能,让上传功能更加简单
1311

1412
![](https://cdn.nlark.com/yuque/0/2019/gif/224563/1561711675156-a7375e06-509a-4722-b2d7-2a2d1ca80008.gif#align=left&display=inline&height=461&originHeight=461&originWidth=480&size=0&status=done&width=480)
1513

@@ -26,16 +24,16 @@ You can configure OSS information through environmental variables, customize dom
2624

2725
## Feature
2826

29-
- Pure front-end implementation, no need for backend cooperation
30-
- The upload function can be done with little oss configuration
31-
- Automatically compress pictures before uploading, and loading prompts during uploading, support picture display and deletion
32-
- With default styles and support customize
33-
- Can limit the size or the number of files to upload
34-
- Support paste screenshot to upload
35-
- Can drag and drop to upload
36-
- Can preivew img
27+
- 纯前端实现,不需要后台配合
28+
- 只需配置 OSS 的基本信息,即可实现上传功能
29+
- 上传前自动压缩图片,上传过程中有 loading 提示,支持图片显示及删除
30+
- 可拓展自定义 loading 和默认上传样式
31+
- 可限制上传文件大小和上传文件数量
32+
- 可截图粘贴上传
33+
- 可拖拽上传
34+
- 可预览图片
3735

38-
[⬆Back to Top](#table-of-contents)
36+
[ Back to Top](#table-of-contents)
3937

4038
## Links
4139

@@ -46,46 +44,59 @@ You can configure OSS information through environmental variables, customize dom
4644

4745
## Install
4846

49-
```bash
47+
```sh
5048
yarn add @femessage/upload-to-ali
5149
```
5250

53-
[⬆Back to Top](#table-of-contents)
51+
[ Back to Top](#table-of-contents)
5452

5553
## Config
5654

57-
The following props are required:`accessKeyId` - Created by Alibaba Cloud Console `accessKeyId`<br />`accessKeySecret` - Created by Alibaba Cloud Console `accessKeySecret`<br />`bucket` - Storage space name<br />`region` - Alibaba Cloud area name
55+
使用时组件以下四个参数必传:
56+
57+
`accessKeyId` - `阿里云控制台创建的access key`
58+
59+
`accessKeySecret` - `阿里云控制台创建的access secret`
60+
61+
`bucket` - `存储空间的名字`
5862

59-
[Be sure to set cross-domain and ACL before using](https://help.aliyun.com/document_detail/32069.html?spm=a2c4g.11186623.6.920.9ddd5557vJ6QU7)
63+
`region` - `根据 存储空间 所在的存储区域, 相应的上传域名`
6064

61-
[⬆Back to Top](#table-of-contents)
65+
[使用前请务必设置跨域 及 ACL](https://help.aliyun.com/document_detail/32069.html?spm=a2c4g.11186623.6.920.9ddd5557vJ6QU7)
66+
67+
[⬆ Back to Top](#table-of-contents)
6268

6369
## Dotenv
6470

65-
Recommend using environment variables to configure OSS parameters<br />With dotenv, we just need to write the environment variable in `.env`. With CI tools, this can meet the needs of using different OSS in different environments without change the source code.<br />Here are all can passed-in environment variables
71+
推荐使用环境变量配置 OSS 参数
72+
73+
使用 dotenv,我们只需要将环境变量配置写在`.env`文件中,配合 CI 工具,可满足同一套代码在不同环境对接不同 OSS 的需求
74+
75+
以下是所有可传入的环境变量
6676

6777
```sh
6878
# .env文件
6979
# OSS上传设置
70-
# required
80+
81+
# 对应组件必要参数 accessKeyId
7182
OSS_KEY=xxx
72-
# required
83+
# 对应组件必要参数 accessKeySecret
7384
OSS_SECRET=xxx
74-
# required
85+
# 对应组件必要参数 bucket
7586
OSS_BUCKET=your-bucket
76-
# required
87+
# 对应组件必要参数 region
7788
OSS_REGION=oss-cn-beijing
78-
# optional
89+
# 对应组件可选参数 dir
7990
OSS_DIR=oss-dir
80-
# optional
91+
# 对应组件可选参数 customDomain
8192
OSS_CUSTOM_DOMAIN=cdn.xxx.com
8293
```
8394

84-
`dotenv` document reference [https://www.npmjs.com/package/dotenv](https://www.npmjs.com/package/dotenv)
95+
`dotenv` 文档参考 https://www.npmjs.com/package/dotenv
8596

8697
### vue-cli3
8798

88-
vue-cli3 offers an easy solution to replace [process.env](https://cli.vuejs.org/zh/guide/mode-and-env.html#%E6%A8%A1%E5%BC%8F), but it requires a pattern(VUE*APP*\*) to inject in client side. So we need to use `dotenv-webpack`'s solution.
99+
vue-cli3 提供了简便的方案替换[环境变量](https://cli.vuejs.org/zh/guide/mode-and-env.html#%E6%A8%A1%E5%BC%8F),但无法在客户端注入。这个场景需要结合`dotenv-webpack`插件。
89100

90101
```js
91102
// vue.config.js
@@ -97,7 +108,7 @@ module.exports = {
97108
}
98109
```
99110

100-
[⬆Back to Top](#table-of-contents)
111+
[ Back to Top](#table-of-contents)
101112

102113
## Contributing
103114

README.md

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/FEMessage/upload-to-ali/pulls)
88
[![Automated Release Notes by gren](https://img.shields.io/badge/%F0%9F%A4%96-release%20notes-00B2EE.svg)](https://github-tools.github.io/github-release-notes/)
99

10-
对接阿里云-OSS,可通过环境变量配置 OSS 信息,可自定义域名,支持多选、限制文件大小、删除、粘贴上传功能,拖拽上传功能,让上传功能更加简单
10+
This component can upload file to Aliyun-OSS easily.
11+
12+
You can configure OSS information through environmental variables, customize domain, support multi-selection, limit file size, delete, paste to upload, drag and drop to upload, make files upload simpler.
1113

1214
![](https://cdn.nlark.com/yuque/0/2019/gif/224563/1561711675156-a7375e06-509a-4722-b2d7-2a2d1ca80008.gif#align=left&display=inline&height=461&originHeight=461&originWidth=480&size=0&status=done&width=480)
1315

14-
[English](./README-en.md)
16+
[中文文档](./README-zh.md)
1517

1618
## Table of Contents
1719

@@ -26,16 +28,16 @@
2628

2729
## Feature
2830

29-
- 纯前端实现,不需要后台配合
30-
- 只需配置 OSS 的基本信息,即可实现上传功能
31-
- 上传前自动压缩图片,上传过程中有 loading 提示,支持图片显示及删除
32-
- 可拓展自定义 loading 和默认上传样式
33-
- 可限制上传文件大小和上传文件数量
34-
- 可截图粘贴上传
35-
- 可拖拽上传
36-
- 可预览图片
31+
- Pure front-end implementation, no need for backend cooperation
32+
- The upload function can be done with little oss configuration
33+
- Automatically compress pictures before uploading, and loading prompts during uploading, support picture display and deletion
34+
- With default styles and support customize
35+
- Can limit the size or the number of files to upload
36+
- Support paste screenshot to upload
37+
- Can drag and drop to upload
38+
- Can preivew img
3739

38-
[ Back to Top](#table-of-contents)
40+
[⬆Back to Top](#table-of-contents)
3941

4042
## Links
4143

@@ -46,59 +48,46 @@
4648

4749
## Install
4850

49-
```sh
51+
```bash
5052
yarn add @femessage/upload-to-ali
5153
```
5254

53-
[ Back to Top](#table-of-contents)
55+
[⬆Back to Top](#table-of-contents)
5456

5557
## Config
5658

57-
使用时组件以下四个参数必传:
58-
59-
`accessKeyId` - `阿里云控制台创建的access key`
60-
61-
`accessKeySecret` - `阿里云控制台创建的access secret`
62-
63-
`bucket` - `存储空间的名字`
59+
The following props are required:`accessKeyId` - Created by Alibaba Cloud Console `accessKeyId`<br />`accessKeySecret` - Created by Alibaba Cloud Console `accessKeySecret`<br />`bucket` - Storage space name<br />`region` - Alibaba Cloud area name
6460

65-
`region` - `根据 存储空间 所在的存储区域, 相应的上传域名`
61+
[Be sure to set cross-domain and ACL before using](https://help.aliyun.com/document_detail/32069.html?spm=a2c4g.11186623.6.920.9ddd5557vJ6QU7)
6662

67-
[使用前请务必设置跨域 及 ACL](https://help.aliyun.com/document_detail/32069.html?spm=a2c4g.11186623.6.920.9ddd5557vJ6QU7)
68-
69-
[⬆ Back to Top](#table-of-contents)
63+
[⬆Back to Top](#table-of-contents)
7064

7165
## Dotenv
7266

73-
推荐使用环境变量配置 OSS 参数
74-
75-
使用 dotenv,我们只需要将环境变量配置写在`.env`文件中,配合 CI 工具,可满足同一套代码在不同环境对接不同 OSS 的需求
76-
77-
以下是所有可传入的环境变量
67+
Recommend using environment variables to configure OSS parameters<br />With dotenv, we just need to write the environment variable in `.env`. With CI tools, this can meet the needs of using different OSS in different environments without change the source code.<br />Here are all can passed-in environment variables
7868

7969
```sh
8070
# .env文件
8171
# OSS上传设置
82-
83-
# 对应组件必要参数 accessKeyId
72+
# required
8473
OSS_KEY=xxx
85-
# 对应组件必要参数 accessKeySecret
74+
# required
8675
OSS_SECRET=xxx
87-
# 对应组件必要参数 bucket
76+
# required
8877
OSS_BUCKET=your-bucket
89-
# 对应组件必要参数 region
78+
# required
9079
OSS_REGION=oss-cn-beijing
91-
# 对应组件可选参数 dir
80+
# optional
9281
OSS_DIR=oss-dir
93-
# 对应组件可选参数 customDomain
82+
# optional
9483
OSS_CUSTOM_DOMAIN=cdn.xxx.com
9584
```
9685

97-
`dotenv` 文档参考 https://www.npmjs.com/package/dotenv
86+
`dotenv` document reference [https://www.npmjs.com/package/dotenv](https://www.npmjs.com/package/dotenv)
9887

9988
### vue-cli3
10089

101-
vue-cli3 提供了简便的方案替换[环境变量](https://cli.vuejs.org/zh/guide/mode-and-env.html#%E6%A8%A1%E5%BC%8F),但无法在客户端注入。这个场景需要结合`dotenv-webpack`插件。
90+
vue-cli3 offers an easy solution to replace [process.env](https://cli.vuejs.org/zh/guide/mode-and-env.html#%E6%A8%A1%E5%BC%8F), but it requires a pattern(VUE*APP*\*) to inject in client side. So we need to use `dotenv-webpack`'s solution.
10291

10392
```js
10493
// vue.config.js
@@ -110,7 +99,7 @@ module.exports = {
11099
}
111100
```
112101

113-
[ Back to Top](#table-of-contents)
102+
[⬆Back to Top](#table-of-contents)
114103

115104
## Contributing
116105

0 commit comments

Comments
 (0)