mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
fix: 修复低代码组件在设计器中使用时切换移动端视图不生效的问题
This commit is contained in:
parent
93f7de0309
commit
0b9764d97b
@ -80,7 +80,8 @@ export class Routes extends Component<{ rendererContainer: SimulatorRendererCont
|
||||
function ucfirst(s: string) {
|
||||
return s.charAt(0).toUpperCase() + s.substring(1);
|
||||
}
|
||||
function getDeviceView(view: any, device: string, mode: string) {
|
||||
|
||||
export function getDeviceView(view: any, device: string, mode: string) {
|
||||
if (!view || typeof view === 'string') {
|
||||
return view;
|
||||
}
|
||||
@ -126,8 +127,8 @@ class Layout extends Component<{ rendererContainer: SimulatorRendererContainer }
|
||||
|
||||
@observer
|
||||
class Renderer extends Component<{
|
||||
rendererContainer: SimulatorRendererContainer,
|
||||
documentInstance: DocumentInstance,
|
||||
rendererContainer: SimulatorRendererContainer;
|
||||
documentInstance: DocumentInstance;
|
||||
}> {
|
||||
startTime: number | null = null;
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React, { createElement, ReactInstance } from 'react';
|
||||
import { render as reactRender } from 'react-dom';
|
||||
import { host } from './host';
|
||||
import SimulatorRendererView from './renderer-view';
|
||||
import SimulatorRendererView, { getDeviceView } from './renderer-view';
|
||||
import { computed, observable as obx, untracked, makeObservable, configure } from 'mobx';
|
||||
import { getClientRects } from './utils/get-client-rects';
|
||||
import { reactFindDOMNodes, FIBER_KEY } from './utils/react-find-dom-nodes';
|
||||
@ -466,7 +466,8 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
|
||||
isEmpty: () => false,
|
||||
};
|
||||
viewProps._leaf = _leaf;
|
||||
return createElement(Comp, viewProps, children);
|
||||
const View = getDeviceView(Comp, renderer.device, renderer.designMode);
|
||||
return createElement(View, viewProps, children);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user