提交 c0d2808c authored 作者: 钟是志's avatar 钟是志

wangEditor组件修改

上级 39f525e3
...@@ -1865,8 +1865,8 @@ export default class tableCom extends Component { ...@@ -1865,8 +1865,8 @@ export default class tableCom extends Component {
); );
break; break;
case 'WangEditor': case 'WangEditor':
cm = (<div dangerouslySetInnerHTML={{__html: obj[dataColumn.base52]}}>
cm = (<div dangerouslySetInnerHTML={{__html: `<div class="wangEditorHtml">${obj[dataColumn.base52]}</div>`}}>
</div>); </div>);
break; break;
case 'TextArea': case 'TextArea':
......
...@@ -44,6 +44,7 @@ export default function Index({ ...@@ -44,6 +44,7 @@ export default function Index({
editor.config.focus = focus; editor.config.focus = focus;
} }
editor.config.onchange = function(newHtml) { editor.config.onchange = function(newHtml) {
console.log(newHtml);
onChangeValue(newHtml); onChangeValue(newHtml);
}; };
...@@ -62,7 +63,7 @@ export default function Index({ ...@@ -62,7 +63,7 @@ export default function Index({
editor.config.pasteFilterStyle = false; // 关闭粘贴样式的过滤 editor.config.pasteFilterStyle = false; // 关闭粘贴样式的过滤
editor.config.uploadImgMaxSize = 3 * 1024 * 1024; // 上传的图片不能大于3M editor.config.uploadImgMaxSize = 3 * 1024 * 1024; // 上传的图片不能大于3M
editor.config.uploadImgMaxLength = 1; // 一次最多上传 1 个图片 editor.config.uploadImgMaxLength = 1; // 一次最多上传 1 个图片
editor.config.showFullScreen = false; editor.config.showFullScreen = false; // 关闭全局变量
editor.config.menus = menus || [ editor.config.menus = menus || [
// 配置菜单 // 配置菜单
'head', 'head',
...@@ -92,11 +93,13 @@ export default function Index({ ...@@ -92,11 +93,13 @@ export default function Index({
editor.create(); editor.create();
console.log(value); console.log(value);
if (value && value.indexOf('wangEditorHtml') > -1) {
editor.txt.html(value); editor.txt.html(value);
} else {
editor.txt.html('<div class="wangEditorHtml">' + value + '</div>'); // if (value && value.indexOf('wangEditorHtml') > -1) {
} // editor.txt.html(value);
// } else {
// editor.txt.html('<div class="wangEditorHtml">' + value + '</div>');
// }
return () => { return () => {
console.log('是否销毁了editor'); console.log('是否销毁了editor');
......
...@@ -16,7 +16,9 @@ function Index({ onChange, value, otherProps, dataColumn, disabled, json, uuid } ...@@ -16,7 +16,9 @@ function Index({ onChange, value, otherProps, dataColumn, disabled, json, uuid }
return null; return null;
} }
if(disabled){ if(disabled){
return <div dangerouslySetInnerHTML={{__html: value}}></div> return <div dangerouslySetInnerHTML={{__html: `<div class="wangEditorHtml">${value}</div>`}}>
</div>
} }
return ( return (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论