fix(editor): 流式布局下通过组件树拖动layout判断不正确

This commit is contained in:
roymondchen 2023-07-21 19:36:51 +08:00
parent 5e316e4d54
commit ce6d2684b7
2 changed files with 2 additions and 2 deletions

View File

@ -156,7 +156,7 @@ const handleDragEnd = async (e: any) => {
if (!tree.value) return;
const { data: node } = e;
const parent = editorService?.getParentById(node.id, false) as MContainer;
const layout = await editorService?.getLayout(parent);
const layout = await editorService?.getLayout(parent, node);
node.style.position = layout;
if (layout === Layout.RELATIVE) {
node.style.top = 0;

View File

@ -193,7 +193,7 @@ class Editor extends BaseService {
/**
*
*/
public async getLayout(parent: MNode, node?: MNode): Promise<Layout> {
public async getLayout(parent: MNode, node?: MNode | null): Promise<Layout> {
if (node && typeof node !== 'function' && isFixed(node)) return Layout.FIXED;
if (parent.layout) {