mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-20 07:14:23 +00:00
Merge branch 'fix/slot-initial' into 'release/0.9.0'
fix: 修复 slot 获取初始值异常的 bug See merge request !920699
This commit is contained in:
commit
66d0ed4b93
@ -1,6 +1,6 @@
|
|||||||
import { ComponentType, ReactElement, isValidElement, ComponentClass } from 'react';
|
import { ComponentType, ReactElement, isValidElement, ComponentClass } from 'react';
|
||||||
import { isPlainObject, uniqueId } from '@ali/lowcode-utils';
|
import { isPlainObject, uniqueId } from '@ali/lowcode-utils';
|
||||||
import { isI18nData, SettingTarget, InitialItem, FilterItem, isJSSlot, ProjectSchema, AutorunItem } from '@ali/lowcode-types';
|
import { isI18nData, SettingTarget, InitialItem, FilterItem, isJSSlot, ProjectSchema, AutorunItem, isJSBlock } from '@ali/lowcode-types';
|
||||||
import { untracked } from '@ali/lowcode-editor-core';
|
import { untracked } from '@ali/lowcode-editor-core';
|
||||||
import { editor, designer } from '../editor';
|
import { editor, designer } from '../editor';
|
||||||
import { SettingField } from '@ali/lowcode-designer';
|
import { SettingField } from '@ali/lowcode-designer';
|
||||||
@ -281,24 +281,19 @@ export function upgradePropConfig(config: OldPropConfig, collector: ConfigCollec
|
|||||||
}
|
}
|
||||||
|
|
||||||
let initialFn = (slotName ? null : initial) || initialValue;
|
let initialFn = (slotName ? null : initial) || initialValue;
|
||||||
// 在 upgrade reducer 做了 JSBlock ——> JSSlot
|
if (slotName && initialValue === true) {
|
||||||
// if (slotName && initialValue === true) {
|
initialFn = (value: any, defaultValue: any) => {
|
||||||
// initialFn = (value: any, defaultValue: any) => {
|
if (isJSBlock(value)) {
|
||||||
// if (isJSSlot(value)) {
|
return value;
|
||||||
// return {
|
}
|
||||||
// title: slotTitle || title,
|
return {
|
||||||
// name: slotName,
|
type: 'JSSlot',
|
||||||
// ...value,
|
title: slotTitle || title,
|
||||||
// };
|
name: slotName,
|
||||||
// }
|
value: initialChildren,
|
||||||
// return {
|
};
|
||||||
// type: 'JSSlot',
|
};
|
||||||
// title: slotTitle || title,
|
}
|
||||||
// name: slotName,
|
|
||||||
// value: initialChildren,
|
|
||||||
// };
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (!slotName) {
|
if (!slotName) {
|
||||||
if (accessor) {
|
if (accessor) {
|
||||||
|
|||||||
@ -55,5 +55,5 @@ export function isJSSlot(data: any): data is JSSlot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isJSBlock(data: any): data is JSBlock {
|
export function isJSBlock(data: any): data is JSBlock {
|
||||||
return data && data.type === 'JSBlock'
|
return data && data.type === 'JSBlock';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user