提交 e88ccf05 authored 作者: tb53863844's avatar tb53863844

修改bug

上级 d130b917
...@@ -1882,7 +1882,7 @@ export default class tableCom extends Component { ...@@ -1882,7 +1882,7 @@ export default class tableCom extends Component {
var initValue; var initValue;
const objinit = { ...init, ...obj }; const objinit = { ...init, ...obj };
if (objinit != null) { if (objinit != null&&Object.keys(objinit).length>0) {
if (this.props.fatherCode != null) { if (this.props.fatherCode != null) {
initValue = initValue =
objinit[this.props.index] != null objinit[this.props.index] != null
...@@ -1893,9 +1893,11 @@ export default class tableCom extends Component { ...@@ -1893,9 +1893,11 @@ export default class tableCom extends Component {
} }
} else { } else {
if (json.initialValue != null) { if (json.initialValue != null) {
try { try {
initValue = JSON.parse(json.initialValue); initValue = JSON.parse(json.initialValue);
} catch (e) { } catch (e) {
console.log(e)
initValue = null; initValue = null;
} }
} }
......
...@@ -52,11 +52,16 @@ export function changeToDraftState(blocks) { ...@@ -52,11 +52,16 @@ export function changeToDraftState(blocks) {
return EditorState.createEmpty(decorator) return EditorState.createEmpty(decorator)
} }
let x; let x;
if(blocks instanceof String){
try{ try{
x = JSON.parse(blocks) x = JSON.parse(blocks)
}catch(e){ }catch(e){
return EditorState.createEmpty(decorator) return EditorState.createEmpty(decorator)
} }
}else{
x=blocks
}
if(!x.blocks){ if(!x.blocks){
return EditorState.createEmpty(decorator) return EditorState.createEmpty(decorator)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论