mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
chore: 优化容器高度拖拽判断
This commit is contained in:
parent
a8f46047c8
commit
b62ab81591
@ -24,6 +24,6 @@
|
||||
|
||||
&-itemColumn {
|
||||
height: 100%;
|
||||
background-color: #999;
|
||||
background-color: #ccc;
|
||||
}
|
||||
}
|
||||
|
@ -142,10 +142,10 @@ export class ContainerPlugin extends LayoutBasePlugin {
|
||||
const node = context.node!;
|
||||
const isFlexItem = this.manager?.isFlexItem(node.id);
|
||||
if (isFlexItem) {
|
||||
let isColumnFlex = String(
|
||||
node.parent?.schema?.style?.flexDirection
|
||||
).includes('column');
|
||||
context?.node.setHeightMutable(false);
|
||||
let isColumnFlex = this.manager.isFlexColumnItem(node.id);
|
||||
context?.node.setHeightMutable(
|
||||
node?.schema?.isFixedHeight && !isColumnFlex
|
||||
);
|
||||
context?.node.setWidthMutable(
|
||||
(!isColumnFlex && context.node.parent?.children?.length > 1) ||
|
||||
node.schema?.style?.flex === '0 0 150px'
|
||||
@ -178,9 +178,7 @@ export class ContainerPlugin extends LayoutBasePlugin {
|
||||
const frameRect = parent.getBoundingClientRect();
|
||||
const rect = dom.getBoundingClientRect();
|
||||
const isFlexItem = this.manager?.isFlexItem(node.id);
|
||||
const isColumnFlex = String(host?.schema?.style?.flexDirection).includes(
|
||||
'column'
|
||||
);
|
||||
const isColumnFlex = this.manager?.isFlexColumnItem(node.id);
|
||||
const schema = node.schema;
|
||||
const index = node.index;
|
||||
const isFlexSize =
|
||||
|
@ -109,9 +109,7 @@ export class FlexPluginBase extends LayoutBasePlugin {
|
||||
if (/^[\d:]+$/.test(value) && isAlive(node)) {
|
||||
let list = value.trim().split(':');
|
||||
let children = node.children || [];
|
||||
const isColumn = String(node.schema?.style?.flexDirection).includes(
|
||||
'column'
|
||||
);
|
||||
const isColumn = this.manager?.isFlexColumnItem(node.id);
|
||||
|
||||
// 更新flex布局
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user