mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-06 10:27:22 +00:00
Merge branch 'fix/jsslot-schema-format' into 'release/0.9.0'
Fix/jsslot schema format See merge request !895040
This commit is contained in:
commit
5016f8d0eb
@ -86,6 +86,8 @@ export class Prop implements IPropParent {
|
|||||||
type: 'JSSlot',
|
type: 'JSSlot',
|
||||||
params: schema.params,
|
params: schema.params,
|
||||||
value: schema.children,
|
value: schema.children,
|
||||||
|
title: schema.title,
|
||||||
|
name: schema.name,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,6 +237,7 @@ export class Prop implements IPropParent {
|
|||||||
const slotSchema: SlotSchema = {
|
const slotSchema: SlotSchema = {
|
||||||
componentName: 'Slot',
|
componentName: 'Slot',
|
||||||
title: data.title,
|
title: data.title,
|
||||||
|
name: data.name,
|
||||||
params: data.params,
|
params: data.params,
|
||||||
children: data.value,
|
children: data.value,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -281,7 +281,7 @@ export function upgradePropConfig(config: OldPropConfig, collector: ConfigCollec
|
|||||||
|
|
||||||
let initialFn = (slotName ? null : initial) || initialValue;
|
let initialFn = (slotName ? null : initial) || initialValue;
|
||||||
if (slotName && initialValue === true) {
|
if (slotName && initialValue === true) {
|
||||||
initialFn = (field: any, value: any) => {
|
initialFn = (value: any, defaultValue: any) => {
|
||||||
if (isJSSlot(value)) {
|
if (isJSSlot(value)) {
|
||||||
return {
|
return {
|
||||||
title: slotTitle || title,
|
title: slotTitle || title,
|
||||||
|
|||||||
@ -55,6 +55,7 @@ function upgradePropsReducer(props: any) {
|
|||||||
val = {
|
val = {
|
||||||
type: 'JSSlot',
|
type: 'JSSlot',
|
||||||
title: (val.value.props as any)?.slotTitle,
|
title: (val.value.props as any)?.slotTitle,
|
||||||
|
name: (val.value.props as any)?.slotName,
|
||||||
value: val.value.children
|
value: val.value.children
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
@ -140,7 +141,6 @@ function compatiableReducer(props: any) {
|
|||||||
const newProps: any = {};
|
const newProps: any = {};
|
||||||
Object.entries<any>(props).forEach(([key, val]) => {
|
Object.entries<any>(props).forEach(([key, val]) => {
|
||||||
if (isJSSlot(val)) {
|
if (isJSSlot(val)) {
|
||||||
val.value
|
|
||||||
val = {
|
val = {
|
||||||
type: 'JSBlock',
|
type: 'JSBlock',
|
||||||
value: {
|
value: {
|
||||||
@ -148,6 +148,7 @@ function compatiableReducer(props: any) {
|
|||||||
children: val.value,
|
children: val.value,
|
||||||
props: {
|
props: {
|
||||||
slotTitle: val.title,
|
slotTitle: val.title,
|
||||||
|
slotName: val.name,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,6 +69,7 @@ export interface BlockSchema extends NodeSchema {
|
|||||||
componentName: 'Block';
|
componentName: 'Block';
|
||||||
}
|
}
|
||||||
export interface SlotSchema extends NodeSchema {
|
export interface SlotSchema extends NodeSchema {
|
||||||
|
name?: string;
|
||||||
componentName: 'Slot';
|
componentName: 'Slot';
|
||||||
params?: string[];
|
params?: string[];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ export interface JSExpression {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface JSSlot {
|
export interface JSSlot {
|
||||||
|
name?: string;
|
||||||
type: 'JSSlot';
|
type: 'JSSlot';
|
||||||
title?: string;
|
title?: string;
|
||||||
// 函数的入参
|
// 函数的入参
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user