Browse Source

feat: update README

node 5 years ago
parent
commit
8ada182d30
4 changed files with 8 additions and 4 deletions
  1. 4
    0
      CHANGELOG.md
  2. 1
    1
      README.md
  3. 2
    2
      src/App.js
  4. 1
    1
      src/index.js

+ 4
- 0
CHANGELOG.md View File

@@ -1,5 +1,9 @@
1 1
 # CHANGELOG
2 2
 
3
+## 1.0.0
4
+
5
+- [x] 完成通用评论国际化
6
+
3 7
 ## 0.5.13
4 8
 - [x] emoji增加到每页30个
5 9
 - [x] emoji增加鼠标滑动功能

+ 1
- 1
README.md View File

@@ -198,7 +198,7 @@ main();
198 198
 | pageType         | string         | more                               | false    | 分页类别, more-加载更多 pagination-页码                                          |
199 199
 | page             | number         |                                    | false    | 页码受控模式,如果传递了此参数,则需要通过onPageChange回调手动维护page.             |
200 200
 | onPageChange     | function(page) |                                    | false    | 页码发生变化时的回调,注意:分页数据获取还是在组件内部处理的                        |
201
-
201
+| locales          | string         | 语言                                | false    | 语言,zh-CN/en-US。默认根据 url 中的 lang 参数来获取。所以一般情况可不传入       |
202 202
 
203 203
 ## Editor
204 204
 

+ 2
- 2
src/App.js View File

@@ -71,7 +71,7 @@ class App extends Component {
71 71
    * 优先级:传入的props > url
72 72
    */
73 73
   loadLocales() {
74
-    let { currentLocale } = this.props;
74
+    let { locales: currentLocale } = this.props;
75 75
     if (!currentLocale) {
76 76
       currentLocale = intl.determineLocale({
77 77
         urlLocaleKey: "lang"
@@ -491,7 +491,7 @@ App.propTypes = {
491 491
   pageType: PropTypes.string, // 分页类型
492 492
   page: PropTypes.number, // 页码
493 493
   onPageChange: PropTypes.func, // 页码变化回调
494
-  currentLocale: PropTypes.string //  传入的语言包
494
+  locales: PropTypes.string //  传入的语言环境, en-US/zh-CN
495 495
 };
496 496
 
497 497
 App.defaultProps = {

+ 1
- 1
src/index.js View File

@@ -1,7 +1,7 @@
1 1
 import React from "react";
2 2
 import ReactDOM from "react-dom";
3 3
 import App, { Editor } from "./App";
4
-import registerServiceWorker from "./registerServiceWorker";
4
+// import registerServiceWorker from "./registerServiceWorker";
5 5
 
6 6
 const Index = props => (
7 7
   <App showAlertComment showAlertReply showAlertFavor showError {...props}>