mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(editor): 流式布局下通过组件树拖动layout判断不正确
This commit is contained in:
parent
5e316e4d54
commit
ce6d2684b7
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user