chore: 解决低代码组件无法渲染的 bug

This commit is contained in:
力皓 2020-12-04 22:36:49 +08:00
parent f14b871b0d
commit 0a09a61bbb
6 changed files with 6 additions and 21 deletions

View File

@ -210,8 +210,6 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
readonly viewport = new Viewport();
readonly scroller = this.designer.createScroller(this.viewport);
mountViewport(viewport: Element | null) {
this.viewport.mount(viewport);
}

View File

@ -169,11 +169,6 @@ const version = '6.0.0 (LowcodeEngine 0.9.32)';
console.log(
`%c VisionEngine %c v${version} `,
<<<<<<< HEAD
'padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060;font-weight:bold;',
'padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e;font-weight:bold;',
=======
'padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;',
'padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;',
>>>>>>> origin/refactor/vision-code-split
);

View File

@ -12,6 +12,6 @@ module.exports = {
'no-prototype-builtins': 0,
'array-callback-return': 0,
'@typescript-eslint/member-ordering': 0,
'react/no-find-dom-node', 0
'react/no-find-dom-node': 0,
}
}

View File

@ -394,11 +394,8 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
// const node = host.currentDocument?.createNode(_schema);
// _schema = node?.export(TransformStage.Render) || {};
const renderer = this;
const { componentsMap } = renderer;
return getComponentController(schema, componentsMap);
}
@ -552,7 +549,6 @@ class ComponentCreator extends React.Component<{ schema: any; propsMap: any, com
}
const props = processPropsSchema(schema.props, propsMap, componentsMap);
const _leaf = host.currentDocument?.createNode(schema);
return createElement(ComponentClass, { ...props, _leaf }, children);
}
}

View File

@ -105,10 +105,6 @@ export function isJSFunction(x: any): x is JSFunction {
return typeof x === 'object' && x && x.type === 'JSFunction';
}
<<<<<<< HEAD
=======
>>>>>>> origin/refactor/vision-code-split
export function isJSSlot(data: any): data is JSSlot {
return data && data.type === 'JSSlot';
}

View File

@ -91,12 +91,12 @@ export function buildComponents(libraryMap: LibraryMap,
components[componentName] = component;
} else {
component = findComponent(libraryMap, componentName, component);
}
if (component) {
if (!acceptsRef(component)) {
component = wrapReactClass(component as FunctionComponent);
if (component) {
if (!acceptsRef(component)) {
component = wrapReactClass(component as FunctionComponent);
}
components[componentName] = component;
}
components[componentName] = component;
}
});
return components;