mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix: 修复flex纵向自定义比例显示重叠问题
This commit is contained in:
parent
a22966f745
commit
c0104f165d
@ -109,7 +109,9 @@ export class FlexPluginBase extends LayoutBasePlugin {
|
||||
if (/^[\d:]+$/.test(value) && isAlive(node)) {
|
||||
let list = value.trim().split(':');
|
||||
let children = node.children || [];
|
||||
const isColumn = this.manager?.isFlexColumnItem(node.id);
|
||||
const isColumn = String(node.schema?.style?.flexDirection).includes(
|
||||
'column'
|
||||
);
|
||||
|
||||
// 更新flex布局
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
@ -236,6 +238,7 @@ export class FlexPluginBase extends LayoutBasePlugin {
|
||||
name: 'layout',
|
||||
label: '快捷版式设置',
|
||||
flexDirection,
|
||||
strictMode: false,
|
||||
pipeIn: () => {
|
||||
if (isAlive(context.node)) {
|
||||
let children = context.node?.children || [];
|
||||
|
@ -48,11 +48,11 @@ function LayoutItem({
|
||||
function FlexLayouts({
|
||||
onChange,
|
||||
value,
|
||||
flexDirection
|
||||
data
|
||||
}: {
|
||||
onChange: (value: string) => void;
|
||||
value?: string;
|
||||
flexDirection?: React.CSSProperties['flexDirection'];
|
||||
data: any;
|
||||
}) {
|
||||
const presetLayouts = [
|
||||
'1',
|
||||
@ -82,6 +82,8 @@ function FlexLayouts({
|
||||
}
|
||||
}, []);
|
||||
|
||||
const flexDirection = data.style?.flexDirection || 'row';
|
||||
|
||||
function onChangeLayout() {
|
||||
if (/\d[\d:]+\d$/.test(currentLayout)) {
|
||||
onChange(currentLayout);
|
||||
|
@ -1500,7 +1500,7 @@ setSchemaTpl(
|
||||
name?: string;
|
||||
label?: string;
|
||||
visibleOn?: string;
|
||||
flexDirection?: string;
|
||||
strictMode?: boolean;
|
||||
pipeIn?: (value: any, data: any) => void;
|
||||
pipeOut?: (value: any, data: any) => void;
|
||||
}) => {
|
||||
@ -1510,9 +1510,9 @@ setSchemaTpl(
|
||||
name: config?.name || 'layout',
|
||||
label: config?.label ?? false,
|
||||
visibleOn: config?.visibleOn,
|
||||
flexDirection: config?.flexDirection,
|
||||
pipeIn: config?.pipeIn,
|
||||
pipeOut: config?.pipeOut
|
||||
pipeOut: config?.pipeOut,
|
||||
strictMode: config?.strictMode
|
||||
};
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user