@lingxiteam/lcdp-ueditor-react 1.0.3-alpha.6 → 1.0.3-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/LcdpUeditor.js +6 -1
- package/lib/LcdpUeditor.js +5 -1
- package/package.json +1 -1
package/es/LcdpUeditor.js
CHANGED
|
@@ -316,6 +316,7 @@ var LcdpUeditor = /*#__PURE__*/function (_React$Component) {
|
|
|
316
316
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
317
317
|
while (1) switch (_context3.prev = _context3.next) {
|
|
318
318
|
case 0:
|
|
319
|
+
// 在弹窗页面中反复开关,会导致 dom 丢失
|
|
319
320
|
readyFunc = function readyFunc() {
|
|
320
321
|
_this3.initConfig();
|
|
321
322
|
var target = document.getElementById(_this3.containerId);
|
|
@@ -331,6 +332,10 @@ var LcdpUeditor = /*#__PURE__*/function (_React$Component) {
|
|
|
331
332
|
}
|
|
332
333
|
_this3.ueditorInst = window.UE.getEditor(_this3.containerId, _this3.editorConfig);
|
|
333
334
|
_this3.ueditorInst.ready(function () {
|
|
335
|
+
var nextValue = filterHtmlNode(_this3.props.value || '').str;
|
|
336
|
+
if (nextValue) {
|
|
337
|
+
_this3.ueditorInst.setContent(nextValue);
|
|
338
|
+
}
|
|
334
339
|
_this3.isReady = true;
|
|
335
340
|
// 禁用状态设置
|
|
336
341
|
if (_this3.props.disabled) {
|
|
@@ -351,8 +356,8 @@ var LcdpUeditor = /*#__PURE__*/function (_React$Component) {
|
|
|
351
356
|
editorBody.addEventListener('compositionend', _this3.compositionEndHandler);
|
|
352
357
|
}
|
|
353
358
|
_this3.initStyle();
|
|
359
|
+
_this3.mountRef();
|
|
354
360
|
});
|
|
355
|
-
_this3.mountRef();
|
|
356
361
|
};
|
|
357
362
|
UeditorResourceLoader.onReady(readyFunc);
|
|
358
363
|
// 默认配置 语言包 统一打包到 ueditor-all.js中
|
package/lib/LcdpUeditor.js
CHANGED
|
@@ -255,6 +255,10 @@ var LcdpUeditor = class extends import_react.default.Component {
|
|
|
255
255
|
}
|
|
256
256
|
this.ueditorInst = window.UE.getEditor(this.containerId, this.editorConfig);
|
|
257
257
|
this.ueditorInst.ready(() => {
|
|
258
|
+
const nextValue = (0, import_filterHtmlNode.filterHtmlNode)(this.props.value || "").str;
|
|
259
|
+
if (nextValue) {
|
|
260
|
+
this.ueditorInst.setContent(nextValue);
|
|
261
|
+
}
|
|
258
262
|
this.isReady = true;
|
|
259
263
|
if (this.props.disabled) {
|
|
260
264
|
this.ueditorInst.setDisabled();
|
|
@@ -272,8 +276,8 @@ var LcdpUeditor = class extends import_react.default.Component {
|
|
|
272
276
|
editorBody.addEventListener("compositionend", this.compositionEndHandler);
|
|
273
277
|
}
|
|
274
278
|
this.initStyle();
|
|
279
|
+
this.mountRef();
|
|
275
280
|
});
|
|
276
|
-
this.mountRef();
|
|
277
281
|
};
|
|
278
282
|
import_UeditorResourceLoader.default.onReady(readyFunc);
|
|
279
283
|
const jsList = [`${this.ueditorPath}/${import_const.DEFAULT_UEDITOR_CONFIG.UEDITOR_ALL}`];
|