Browse Source

feat: update README

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

+ 1
- 1
README.md View File

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

+ 2
- 2
src/App.js View File

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

+ 1
- 1
src/index.js View File

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