mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-07 19:13:01 +00:00
chore: vision polyfill增加icon配置
This commit is contained in:
parent
76435d4995
commit
df0328ddb1
@ -1,6 +1,7 @@
|
|||||||
import { skeleton, editor } from '@ali/lowcode-engine';
|
import { skeleton, editor } from '@ali/lowcode-engine';
|
||||||
import { ReactElement } from 'react';
|
import { ReactElement } from 'react';
|
||||||
import { IWidgetBaseConfig } from '@ali/lowcode-editor-skeleton';
|
import { IWidgetBaseConfig } from '@ali/lowcode-editor-skeleton';
|
||||||
|
import { IconType } from '@ali/lowcode-types';
|
||||||
import { uniqueId } from '@ali/lowcode-utils';
|
import { uniqueId } from '@ali/lowcode-utils';
|
||||||
import bus from './bus';
|
import bus from './bus';
|
||||||
|
|
||||||
@ -50,6 +51,7 @@ export interface OldPaneConfig {
|
|||||||
canSetFixed?: boolean; // 是否可以设置固定模式
|
canSetFixed?: boolean; // 是否可以设置固定模式
|
||||||
defaultFixed?: boolean; // 是否默认固定
|
defaultFixed?: boolean; // 是否默认固定
|
||||||
enableDrag?: boolean;
|
enableDrag?: boolean;
|
||||||
|
icon?: IconType; // 支持旧vision pane传icon (menu是title, 并非icon)
|
||||||
}
|
}
|
||||||
|
|
||||||
function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: string } {
|
function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: string } {
|
||||||
@ -81,6 +83,7 @@ function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: strin
|
|||||||
height,
|
height,
|
||||||
maxHeight,
|
maxHeight,
|
||||||
menu,
|
menu,
|
||||||
|
icon,
|
||||||
isAction,
|
isAction,
|
||||||
canSetFixed,
|
canSetFixed,
|
||||||
defaultFixed,
|
defaultFixed,
|
||||||
@ -89,6 +92,9 @@ function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: strin
|
|||||||
if (menu) {
|
if (menu) {
|
||||||
newConfig.props.title = menu;
|
newConfig.props.title = menu;
|
||||||
}
|
}
|
||||||
|
if (icon) {
|
||||||
|
newConfig.props.icon = icon;
|
||||||
|
}
|
||||||
if (isAction) {
|
if (isAction) {
|
||||||
newConfig.type = 'Dock';
|
newConfig.type = 'Dock';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user