|
@@ -27,6 +27,10 @@ var _axios = require("axios");
|
27
|
27
|
|
28
|
28
|
var _axios2 = _interopRequireDefault(_axios);
|
29
|
29
|
|
|
30
|
+var _reactIntlUniversal = require("react-intl-universal");
|
|
31
|
+
|
|
32
|
+var _reactIntlUniversal2 = _interopRequireDefault(_reactIntlUniversal);
|
|
33
|
+
|
30
|
34
|
var _constant = require("./constant");
|
31
|
35
|
|
32
|
36
|
var _Comment = require("./Comment");
|
|
@@ -51,19 +55,30 @@ var _RenderText2 = _interopRequireDefault(_RenderText);
|
51
|
55
|
|
52
|
56
|
var _lang = require("./lang");
|
53
|
57
|
|
54
|
|
-var _lang2 = _interopRequireDefault(_lang);
|
|
58
|
+var _enUS = require("./lang/en-US.js");
|
|
59
|
+
|
|
60
|
+var _enUS2 = _interopRequireDefault(_enUS);
|
|
61
|
+
|
|
62
|
+var _zhCN = require("./lang/zh-CN.js");
|
|
63
|
+
|
|
64
|
+var _zhCN2 = _interopRequireDefault(_zhCN);
|
55
|
65
|
|
56
|
66
|
require("./App.css");
|
57
|
67
|
|
58
|
68
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
59
|
69
|
|
|
70
|
+function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
71
|
+
|
60
|
72
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
61
|
73
|
|
62
|
74
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
63
|
75
|
|
64
|
76
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
65
|
77
|
|
66
|
|
-// import styles from "./App.module.css";
|
|
78
|
+var LOCALES = {
|
|
79
|
+ "zh-CN": _zhCN2.default,
|
|
80
|
+ "en-US": _enUS2.default
|
|
81
|
+};
|
67
|
82
|
|
68
|
83
|
var App = function (_Component) {
|
69
|
84
|
_inherits(App, _Component);
|
|
@@ -84,7 +99,9 @@ var App = function (_Component) {
|
84
|
99
|
page: 1,
|
85
|
100
|
total: 0,
|
86
|
101
|
// 是否没有更多评论了
|
87
|
|
- isNoMoreComment: false
|
|
102
|
+ isNoMoreComment: false,
|
|
103
|
+ initDone: false,
|
|
104
|
+ locale: "zh-CN"
|
88
|
105
|
};
|
89
|
106
|
_this.handleChangeLoading = _this.handleChangeLoading.bind(_this);
|
90
|
107
|
_this.sCreateComment = _this.sCreateComment.bind(_this);
|
|
@@ -111,7 +128,38 @@ var App = function (_Component) {
|
111
|
128
|
}
|
112
|
129
|
}, {
|
113
|
130
|
key: "componentDidMount",
|
114
|
|
- value: function componentDidMount() {}
|
|
131
|
+ value: function componentDidMount() {
|
|
132
|
+ this.loadLocales();
|
|
133
|
+ }
|
|
134
|
+
|
|
135
|
+ /**
|
|
136
|
+ * 加载语言包
|
|
137
|
+ * 只能根据url或者传入的props来确定加载哪个语言包
|
|
138
|
+ * 优先级:传入的props > url
|
|
139
|
+ */
|
|
140
|
+
|
|
141
|
+ }, {
|
|
142
|
+ key: "loadLocales",
|
|
143
|
+ value: function loadLocales() {
|
|
144
|
+ var _this2 = this;
|
|
145
|
+
|
|
146
|
+ var currentLocale = this.props.locales;
|
|
147
|
+
|
|
148
|
+ if (!currentLocale) {
|
|
149
|
+ currentLocale = _reactIntlUniversal2.default.determineLocale({
|
|
150
|
+ urlLocaleKey: "lang"
|
|
151
|
+ });
|
|
152
|
+ }
|
|
153
|
+ currentLocale = _lang.SUPPORT_LOCALES.find(function (item) {
|
|
154
|
+ return item.value === currentLocale;
|
|
155
|
+ }) ? currentLocale : "zh-CN";
|
|
156
|
+ _reactIntlUniversal2.default.init({
|
|
157
|
+ currentLocale: currentLocale,
|
|
158
|
+ locales: _defineProperty({}, currentLocale, LOCALES[currentLocale])
|
|
159
|
+ }).then(function () {
|
|
160
|
+ _this2.setState({ initDone: true, locale: currentLocale });
|
|
161
|
+ });
|
|
162
|
+ }
|
115
|
163
|
}, {
|
116
|
164
|
key: "error",
|
117
|
165
|
value: function error(msg) {
|
|
@@ -127,13 +175,16 @@ var App = function (_Component) {
|
127
|
175
|
}, {
|
128
|
176
|
key: "errorHandler",
|
129
|
177
|
value: function errorHandler(error) {
|
|
178
|
+ var locale = this.state.locale;
|
|
179
|
+
|
|
180
|
+ var localResponse = _lang.LOCALES_RESPONSE[locale];
|
130
|
181
|
if (error.response && error.response.data && error.response.data.msg) {
|
131
|
|
- this.error(_lang2.default[error.response.data.msg] || _constant.ERROR_DEFAULT, {
|
|
182
|
+ this.error(localResponse[error.response.data.msg] || _constant.ERROR_DEFAULT, {
|
132
|
183
|
response: error.response
|
133
|
184
|
});
|
134
|
185
|
return;
|
135
|
186
|
}
|
136
|
|
- this.error(_lang2.default[error.message] || _constant.ERROR_DEFAULT, {
|
|
187
|
+ this.error(localResponse[error.response.data.msg] || _constant.ERROR_DEFAULT, {
|
137
|
188
|
response: error.response
|
138
|
189
|
});
|
139
|
190
|
}
|
|
@@ -160,7 +211,7 @@ var App = function (_Component) {
|
160
|
211
|
}, {
|
161
|
212
|
key: "sGetComment",
|
162
|
213
|
value: function sGetComment() {
|
163
|
|
- var _this2 = this;
|
|
214
|
+ var _this3 = this;
|
164
|
215
|
|
165
|
216
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
166
|
217
|
_ref$page = _ref.page,
|
|
@@ -182,7 +233,7 @@ var App = function (_Component) {
|
182
|
233
|
|
183
|
234
|
if (list) {
|
184
|
235
|
var newList = list;
|
185
|
|
- var oldList = _this2.state.list;
|
|
236
|
+ var oldList = _this3.state.list;
|
186
|
237
|
|
187
|
238
|
if (pageType === "more") {
|
188
|
239
|
if (page > 1) {
|
|
@@ -197,19 +248,19 @@ var App = function (_Component) {
|
197
|
248
|
window.scrollTo(0, 0);
|
198
|
249
|
}
|
199
|
250
|
|
200
|
|
- _this2.setState({
|
|
251
|
+ _this3.setState({
|
201
|
252
|
list: newList,
|
202
|
253
|
page: page,
|
203
|
254
|
total: total
|
204
|
255
|
});
|
205
|
256
|
} else {
|
206
|
|
- _message3.default.info("没有更多评论了");
|
207
|
|
- _this2.setState({
|
|
257
|
+ _message3.default.info(_reactIntlUniversal2.default.get("message.noMoreComment"));
|
|
258
|
+ _this3.setState({
|
208
|
259
|
isNoMoreComment: true
|
209
|
260
|
});
|
210
|
261
|
}
|
211
|
262
|
}).catch(this.errorHandler).finally(function () {
|
212
|
|
- _this2.handleChangeLoading("sGetComment", false);
|
|
263
|
+ _this3.handleChangeLoading("sGetComment", false);
|
213
|
264
|
});
|
214
|
265
|
}
|
215
|
266
|
|
|
@@ -220,7 +271,7 @@ var App = function (_Component) {
|
220
|
271
|
}, {
|
221
|
272
|
key: "sGetReply",
|
222
|
273
|
value: function sGetReply() {
|
223
|
|
- var _this3 = this;
|
|
274
|
+ var _this4 = this;
|
224
|
275
|
|
225
|
276
|
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
226
|
277
|
commentId = _ref2.commentId,
|
|
@@ -232,9 +283,9 @@ var App = function (_Component) {
|
232
|
283
|
|
233
|
284
|
this.axios.get(API + "/replies?comment_id=" + commentId + "&page=" + page + "&limit=" + _constant.LIMIT).then(function (response) {
|
234
|
285
|
if (!response.data.list) {
|
235
|
|
- _message3.default.info("没有更多数据了!");
|
|
286
|
+ _message3.default.info(_reactIntlUniversal2.default.get("message.noMoreData"));
|
236
|
287
|
}
|
237
|
|
- var list = _this3.state.list.map(function (item) {
|
|
288
|
+ var list = _this4.state.list.map(function (item) {
|
238
|
289
|
if (item.id === commentId) {
|
239
|
290
|
if (!item.replies) item.replies = [];
|
240
|
291
|
if (response.data.list) {
|
|
@@ -256,9 +307,9 @@ var App = function (_Component) {
|
256
|
307
|
}
|
257
|
308
|
return item;
|
258
|
309
|
});
|
259
|
|
- _this3.setState({ list: list });
|
|
310
|
+ _this4.setState({ list: list });
|
260
|
311
|
}).catch(this.errorHandler).finally(function () {
|
261
|
|
- _this3.handleChangeLoading("sGetReply", false);
|
|
312
|
+ _this4.handleChangeLoading("sGetReply", false);
|
262
|
313
|
});
|
263
|
314
|
}
|
264
|
315
|
|
|
@@ -270,14 +321,14 @@ var App = function (_Component) {
|
270
|
321
|
}, {
|
271
|
322
|
key: "sCreateComment",
|
272
|
323
|
value: function sCreateComment() {
|
273
|
|
- var _this4 = this;
|
|
324
|
+ var _this5 = this;
|
274
|
325
|
|
275
|
326
|
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
276
|
327
|
content = _ref3.content;
|
277
|
328
|
|
278
|
329
|
var cb = arguments[1];
|
279
|
330
|
|
280
|
|
- if (!content) return this.error("评论内容不能为空 ");
|
|
331
|
+ if (!content) return this.error(_reactIntlUniversal2.default.get("message.notNull"));
|
281
|
332
|
this.handleChangeLoading("sCreateComment", true);
|
282
|
333
|
var _props2 = this.props,
|
283
|
334
|
API = _props2.API,
|
|
@@ -293,23 +344,23 @@ var App = function (_Component) {
|
293
|
344
|
},
|
294
|
345
|
withCredentials: true
|
295
|
346
|
}).then(function (response) {
|
296
|
|
- if (_this4.props.showAlertComment) {
|
297
|
|
- _message3.default.success("评论成功!");
|
|
347
|
+ if (_this5.props.showAlertComment) {
|
|
348
|
+ _message3.default.success(_reactIntlUniversal2.default.get("message.success"));
|
298
|
349
|
}
|
299
|
350
|
if ((0, _helper.isFunction)(cb)) cb();
|
300
|
351
|
// 将数据写入到 list 中
|
301
|
352
|
// 临时插入
|
302
|
353
|
// 等到获取数据之后,删除临时数据
|
303
|
|
- var _state = _this4.state,
|
|
354
|
+ var _state = _this5.state,
|
304
|
355
|
list = _state.list,
|
305
|
356
|
total = _state.total;
|
306
|
357
|
|
307
|
358
|
list.unshift(_extends({}, response.data, {
|
308
|
359
|
isTemporary: true // 临时的数据
|
309
|
360
|
}));
|
310
|
|
- _this4.setState({ list: list, total: total + 1 });
|
|
361
|
+ _this5.setState({ list: list, total: total + 1 });
|
311
|
362
|
}).catch(this.errorHandler).finally(function () {
|
312
|
|
- _this4.handleChangeLoading("sCreateComment", false);
|
|
363
|
+ _this5.handleChangeLoading("sCreateComment", false);
|
313
|
364
|
});
|
314
|
365
|
}
|
315
|
366
|
|
|
@@ -320,7 +371,7 @@ var App = function (_Component) {
|
320
|
371
|
}, {
|
321
|
372
|
key: "sDeleteComment",
|
322
|
373
|
value: function sDeleteComment(commentId) {
|
323
|
|
- var _this5 = this;
|
|
374
|
+ var _this6 = this;
|
324
|
375
|
|
325
|
376
|
this.handleChangeLoading("sDeleteComment", true);
|
326
|
377
|
var API = this.props.API;
|
|
@@ -329,16 +380,17 @@ var App = function (_Component) {
|
329
|
380
|
method: "delete",
|
330
|
381
|
withCredentials: true
|
331
|
382
|
}).then(function () {
|
332
|
|
- var _state2 = _this5.state,
|
|
383
|
+ var _state2 = _this6.state,
|
333
|
384
|
list = _state2.list,
|
334
|
385
|
total = _state2.total;
|
335
|
386
|
|
336
|
387
|
var res = list.filter(function (item) {
|
337
|
388
|
return item.id !== commentId;
|
338
|
389
|
});
|
339
|
|
- _this5.setState({ list: res, total: total - 1 });
|
|
390
|
+ _this6.setState({ list: res, total: total - 1 });
|
|
391
|
+ _this6.props.onDelete(_constant.COMMENT_TYPE.COMMENT);
|
340
|
392
|
}).catch(this.errorHandler).finally(function () {
|
341
|
|
- _this5.handleChangeLoading("sDeleteComment", false);
|
|
393
|
+ _this6.handleChangeLoading("sDeleteComment", false);
|
342
|
394
|
});
|
343
|
395
|
}
|
344
|
396
|
|
|
@@ -351,9 +403,9 @@ var App = function (_Component) {
|
351
|
403
|
}, {
|
352
|
404
|
key: "sCreateReply",
|
353
|
405
|
value: function sCreateReply(data, cb) {
|
354
|
|
- var _this6 = this;
|
|
406
|
+ var _this7 = this;
|
355
|
407
|
|
356
|
|
- if (!data.content) return this.error("回复内容不能为空 ");
|
|
408
|
+ if (!data.content) return this.error(_reactIntlUniversal2.default.get("message.replyNoNull"));
|
357
|
409
|
this.handleChangeLoading("sCreateReply", true);
|
358
|
410
|
var API = this.props.API;
|
359
|
411
|
|
|
@@ -362,14 +414,14 @@ var App = function (_Component) {
|
362
|
414
|
data: data,
|
363
|
415
|
withCredentials: true
|
364
|
416
|
}).then(function (response) {
|
365
|
|
- if (_this6.props.showAlertReply) {
|
366
|
|
- _message3.default.success("回复成功!");
|
|
417
|
+ if (_this7.props.showAlertReply) {
|
|
418
|
+ _message3.default.success(_reactIntlUniversal2.default.get("message.replySuccess"));
|
367
|
419
|
}
|
368
|
420
|
if ((0, _helper.isFunction)(cb)) cb();
|
369
|
421
|
// 将数据写入到 list 中
|
370
|
422
|
// 临时插入
|
371
|
423
|
// 等到获取数据之后,删除临时数据
|
372
|
|
- var list = _this6.state.list.map(function (item) {
|
|
424
|
+ var list = _this7.state.list.map(function (item) {
|
373
|
425
|
if (item.id === data.comment_id) {
|
374
|
426
|
if (!item.replies) item.replies = [];
|
375
|
427
|
item.replies.push(_extends({}, response.data, {
|
|
@@ -379,9 +431,9 @@ var App = function (_Component) {
|
379
|
431
|
}
|
380
|
432
|
return item;
|
381
|
433
|
});
|
382
|
|
- _this6.setState({ list: list });
|
|
434
|
+ _this7.setState({ list: list });
|
383
|
435
|
}).catch(this.errorHandler).finally(function () {
|
384
|
|
- _this6.handleChangeLoading("sCreateReply", false);
|
|
436
|
+ _this7.handleChangeLoading("sCreateReply", false);
|
385
|
437
|
});
|
386
|
438
|
}
|
387
|
439
|
|
|
@@ -394,7 +446,7 @@ var App = function (_Component) {
|
394
|
446
|
}, {
|
395
|
447
|
key: "sDeleteReply",
|
396
|
448
|
value: function sDeleteReply(replyId, commentId) {
|
397
|
|
- var _this7 = this;
|
|
449
|
+ var _this8 = this;
|
398
|
450
|
|
399
|
451
|
this.handleChangeLoading("sDeleteReply", true);
|
400
|
452
|
var API = this.props.API;
|
|
@@ -403,7 +455,7 @@ var App = function (_Component) {
|
403
|
455
|
method: "delete",
|
404
|
456
|
withCredentials: true
|
405
|
457
|
}).then(function () {
|
406
|
|
- var list = _this7.state.list.map(function (item) {
|
|
458
|
+ var list = _this8.state.list.map(function (item) {
|
407
|
459
|
if (item.id === commentId) {
|
408
|
460
|
var replies = item.replies.filter(function (item) {
|
409
|
461
|
return item.id !== replyId;
|
|
@@ -413,9 +465,10 @@ var App = function (_Component) {
|
413
|
465
|
}
|
414
|
466
|
return item;
|
415
|
467
|
});
|
416
|
|
- _this7.setState({ list: list });
|
|
468
|
+ _this8.setState({ list: list });
|
|
469
|
+ _this8.props.onDelete(_constant.COMMENT_TYPE.REPLY);
|
417
|
470
|
}).catch(this.errorHandler).finally(function () {
|
418
|
|
- _this7.handleChangeLoading("sDeleteReply", false);
|
|
471
|
+ _this8.handleChangeLoading("sDeleteReply", false);
|
419
|
472
|
});
|
420
|
473
|
}
|
421
|
474
|
|
|
@@ -428,7 +481,7 @@ var App = function (_Component) {
|
428
|
481
|
}, {
|
429
|
482
|
key: "sCommentFavor",
|
430
|
483
|
value: function sCommentFavor(commentId, favored) {
|
431
|
|
- var _this8 = this;
|
|
484
|
+ var _this9 = this;
|
432
|
485
|
|
433
|
486
|
this.handleChangeLoading("sCommentFavor", true);
|
434
|
487
|
var API = this.props.API;
|
|
@@ -437,20 +490,20 @@ var App = function (_Component) {
|
437
|
490
|
method: favored ? "delete" : "put",
|
438
|
491
|
withCredentials: true
|
439
|
492
|
}).then(function (response) {
|
440
|
|
- if (_this8.props.showAlertFavor) {
|
441
|
|
- _message3.default.success(favored ? "取消点赞成功!" : "点赞成功!");
|
|
493
|
+ if (_this9.props.showAlertFavor) {
|
|
494
|
+ _message3.default.success(favored ? _reactIntlUniversal2.default.get("message.cancelLickSuccess") : _reactIntlUniversal2.default.get("message.likeSuccess"));
|
442
|
495
|
}
|
443
|
496
|
// 更新 list 中的该项数据的 favored
|
444
|
|
- var list = _this8.state.list.map(function (item) {
|
|
497
|
+ var list = _this9.state.list.map(function (item) {
|
445
|
498
|
if (item.id === commentId) {
|
446
|
499
|
item.favored = !favored;
|
447
|
500
|
item.favor_count += favored ? -1 : 1;
|
448
|
501
|
}
|
449
|
502
|
return item;
|
450
|
503
|
});
|
451
|
|
- _this8.setState({ list: list });
|
|
504
|
+ _this9.setState({ list: list });
|
452
|
505
|
}).catch(this.errorHandler).finally(function () {
|
453
|
|
- _this8.handleChangeLoading("sCommentFavor", false);
|
|
506
|
+ _this9.handleChangeLoading("sCommentFavor", false);
|
454
|
507
|
});
|
455
|
508
|
}
|
456
|
509
|
|
|
@@ -464,7 +517,7 @@ var App = function (_Component) {
|
464
|
517
|
}, {
|
465
|
518
|
key: "sReplyFavor",
|
466
|
519
|
value: function sReplyFavor(replyId, commentId, favored) {
|
467
|
|
- var _this9 = this;
|
|
520
|
+ var _this10 = this;
|
468
|
521
|
|
469
|
522
|
this.handleChangeLoading("sReplyFavor", true);
|
470
|
523
|
var API = this.props.API;
|
|
@@ -476,9 +529,9 @@ var App = function (_Component) {
|
476
|
529
|
},
|
477
|
530
|
withCredentials: true
|
478
|
531
|
}).then(function (response) {
|
479
|
|
- _message3.default.success(favored ? "取消点赞成功!" : "点赞成功!");
|
|
532
|
+ _message3.default.success(favored ? _reactIntlUniversal2.default.get("message.cancelLickSuccess") : _reactIntlUniversal2.default.get("message.likeSuccess"));
|
480
|
533
|
// 更新 list 中的该项数据的 favored
|
481
|
|
- var list = _this9.state.list.map(function (item) {
|
|
534
|
+ var list = _this10.state.list.map(function (item) {
|
482
|
535
|
if (item.id === commentId) {
|
483
|
536
|
item.replies = item.replies.map(function (r) {
|
484
|
537
|
if (r.id === replyId) {
|
|
@@ -493,9 +546,9 @@ var App = function (_Component) {
|
493
|
546
|
}
|
494
|
547
|
return item;
|
495
|
548
|
});
|
496
|
|
- _this9.setState({ list: list });
|
|
549
|
+ _this10.setState({ list: list });
|
497
|
550
|
}).catch(this.errorHandler).finally(function () {
|
498
|
|
- _this9.handleChangeLoading("sReplyFavor", false);
|
|
551
|
+ _this10.handleChangeLoading("sReplyFavor", false);
|
499
|
552
|
});
|
500
|
553
|
}
|
501
|
554
|
|
|
@@ -506,15 +559,15 @@ var App = function (_Component) {
|
506
|
559
|
}, {
|
507
|
560
|
key: "sOssSts",
|
508
|
561
|
value: function sOssSts() {
|
509
|
|
- var _this10 = this;
|
|
562
|
+ var _this11 = this;
|
510
|
563
|
|
511
|
564
|
this.handleChangeLoading("sOssSts", true);
|
512
|
565
|
var API = this.props.API;
|
513
|
566
|
|
514
|
567
|
this.axios.get(API + "/oss/sts").then(function (response) {
|
515
|
|
- _this10.setState({ oss: _extends({}, response.data) });
|
|
568
|
+ _this11.setState({ oss: _extends({}, response.data) });
|
516
|
569
|
}).catch(this.errorHandler).finally(function () {
|
517
|
|
- _this10.handleChangeLoading("sOssSts", false);
|
|
570
|
+ _this11.handleChangeLoading("sOssSts", false);
|
518
|
571
|
});
|
519
|
572
|
}
|
520
|
573
|
}, {
|
|
@@ -533,7 +586,7 @@ var App = function (_Component) {
|
533
|
586
|
sDeleteReply: this.sDeleteReply
|
534
|
587
|
});
|
535
|
588
|
|
536
|
|
- return _react2.default.createElement(
|
|
589
|
+ return this.state.initDone && _react2.default.createElement(
|
537
|
590
|
_Comment.CommentContext.Provider,
|
538
|
591
|
{ value: value },
|
539
|
592
|
_react2.default.createElement(
|
|
@@ -567,7 +620,9 @@ App.propTypes = {
|
567
|
620
|
userId: _propTypes2.default.number, // 用户id, comment内部不维护用户id, 调用组件时传递过来, 目前用于判断是否显示删除按钮
|
568
|
621
|
pageType: _propTypes2.default.string, // 分页类型
|
569
|
622
|
page: _propTypes2.default.number, // 页码
|
570
|
|
- onPageChange: _propTypes2.default.func // 页码变化回调
|
|
623
|
+ onPageChange: _propTypes2.default.func, // 页码变化回调
|
|
624
|
+ onDelete: _propTypes2.default.func,
|
|
625
|
+ locales: _propTypes2.default.string // 传入的语言环境, en-US/zh-CN
|
571
|
626
|
};
|
572
|
627
|
|
573
|
628
|
App.defaultProps = {
|
|
@@ -579,7 +634,8 @@ App.defaultProps = {
|
579
|
634
|
showAlertFavor: false,
|
580
|
635
|
showError: true,
|
581
|
636
|
pageType: "more",
|
582
|
|
- onPageChange: function onPageChange(page) {}
|
|
637
|
+ onPageChange: function onPageChange(page) {},
|
|
638
|
+ onDelete: function onDelete() {}
|
583
|
639
|
};
|
584
|
640
|
|
585
|
641
|
exports.Editor = _Editor2.default;
|