fix: 区块模板根节点支持 Div

This commit is contained in:
mario.gk 2020-06-28 15:17:44 +08:00
parent 15c8988a24
commit c3b796e6a2

View File

@ -23,7 +23,7 @@ const ENGINE_COMPS = {
BlockEngine, BlockEngine,
AddonEngine, AddonEngine,
TempEngine, TempEngine,
// DivEngine: BlockEngine, DivEngine: BlockEngine,
}; };
class FaultComponent extends PureComponent { class FaultComponent extends PureComponent {
@ -141,7 +141,7 @@ export default class Engine extends PureComponent {
} }
createElement(Component, props, children) { createElement(Component, props, children) {
// TODO: enable in runtime mode? // TODO: enable in runtime mode?s
this.patchDidCatch(Component); this.patchDidCatch(Component);
return (this.props.customCreateElement || reactCreateElement)(Component, props, children); return (this.props.customCreateElement || reactCreateElement)(Component, props, children);
} }
@ -157,7 +157,8 @@ export default class Engine extends PureComponent {
if (isEmpty(schema)) { if (isEmpty(schema)) {
return null; return null;
} }
if (!isFileSchema(schema)) { //
if (schema.componentName !== 'Div' && !isFileSchema(schema)) {
return '模型结构异常'; return '模型结构异常';
} }
debug('entry.render'); debug('entry.render');