mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 09:41:57 +00:00
actionPane 支持 index
This commit is contained in:
parent
550fdde7f7
commit
db6f231176
@ -140,20 +140,20 @@ function initDemoPanes() {
|
||||
children: '保存',
|
||||
}),
|
||||
});
|
||||
skeleton.add({
|
||||
area: 'topArea',
|
||||
type: 'Dock',
|
||||
name: 'preview4',
|
||||
props: {
|
||||
align: 'center',
|
||||
},
|
||||
content: createElement('img', {
|
||||
src: 'https://img.alicdn.com/tfs/TB1WW.VC.z1gK0jSZLeXXb9kVXa-486-64.png',
|
||||
style: {
|
||||
height: 32,
|
||||
},
|
||||
}),
|
||||
});
|
||||
// skeleton.add({
|
||||
// area: 'topArea',
|
||||
// type: 'Dock',
|
||||
// name: 'preview4',
|
||||
// props: {
|
||||
// align: 'center',
|
||||
// },
|
||||
// content: createElement('img', {
|
||||
// src: 'https://img.alicdn.com/tfs/TB1WW.VC.z1gK0jSZLeXXb9kVXa-486-64.png',
|
||||
// style: {
|
||||
// height: 32,
|
||||
// },
|
||||
// }),
|
||||
// });
|
||||
skeleton.add({
|
||||
area: 'topArea',
|
||||
type: 'Dock',
|
||||
|
||||
@ -24,7 +24,11 @@ class Contents extends Component<{ area: Area }> {
|
||||
const left: any[] = [];
|
||||
const center: any[] = [];
|
||||
const right: any[] = [];
|
||||
area.container.items.forEach(item => {
|
||||
area.container.items.sort((a,b) => {
|
||||
const index1 = a.config?.index || 0;
|
||||
const index2 = b.config?.index || 0;
|
||||
return index1 === index2 ? 0 : (index1 > index2 ? 1 : -1);
|
||||
}).forEach(item => {
|
||||
if (item.align === 'center') {
|
||||
center.push(item.content);
|
||||
} else if (item.align === 'left') {
|
||||
|
||||
@ -63,7 +63,7 @@ function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: strin
|
||||
onDestroy: destroy,
|
||||
},
|
||||
contentProps: props,
|
||||
index,
|
||||
index: props?.index,
|
||||
};
|
||||
if (type === 'dock') {
|
||||
newConfig.type = 'PanelDock';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user