mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-11 18:42:56 +00:00
fix: when the component is configured in a loop, the key value changes and renders error
This commit is contained in:
parent
29b91846fb
commit
5db418efe4
@ -774,6 +774,11 @@ export default function baseRendererFactory(): IBaseRenderComponent {
|
||||
{
|
||||
...schema,
|
||||
loop: undefined,
|
||||
props: {
|
||||
...schema.props,
|
||||
// 循环下 key 不能为常量,这样会造成 key 值重复,渲染异常
|
||||
key: isJSExpression(schema.props?.key) ? schema.props?.key : null,
|
||||
},
|
||||
},
|
||||
loopSelf,
|
||||
parentInfo,
|
||||
|
||||
@ -13,6 +13,11 @@ export interface IPluginPreferenceMananger {
|
||||
export type PluginOptionsType = string | number | boolean | object;
|
||||
|
||||
export interface IPublicApiPlugins {
|
||||
/**
|
||||
* 可以通过 plugin api 获取其他插件 export 导出的内容
|
||||
*/
|
||||
[key: string]: any;
|
||||
|
||||
register(
|
||||
pluginModel: IPublicTypePlugin,
|
||||
options?: Record<string, PluginOptionsType>,
|
||||
@ -21,6 +26,7 @@ export interface IPublicApiPlugins {
|
||||
|
||||
/**
|
||||
* 引擎初始化时可以提供全局配置给到各插件,通过这个方法可以获得本插件对应的配置
|
||||
*
|
||||
* use this to get preference config for this plugin when engine.init() called
|
||||
*/
|
||||
getPluginPreference(
|
||||
@ -29,24 +35,28 @@ export interface IPublicApiPlugins {
|
||||
|
||||
/**
|
||||
* 获取指定插件
|
||||
*
|
||||
* get plugin instance by name
|
||||
*/
|
||||
get(pluginName: string): IPublicModelPluginInstance | null;
|
||||
|
||||
/**
|
||||
* 获取所有的插件实例
|
||||
*
|
||||
* get all plugin instances
|
||||
*/
|
||||
getAll(): IPublicModelPluginInstance[];
|
||||
|
||||
/**
|
||||
* 判断是否有指定插件
|
||||
*
|
||||
* check if plugin with certain name exists
|
||||
*/
|
||||
has(pluginName: string): boolean;
|
||||
|
||||
/**
|
||||
* 删除指定插件
|
||||
*
|
||||
* delete plugin instance by name
|
||||
*/
|
||||
delete(pluginName: string): void;
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
import { IPublicTypeCompositeObject } from './';
|
||||
import { IPublicTypeCompositeObject, IPublicTypeNodeData } from './';
|
||||
|
||||
export type IPublicTypePropsMap = IPublicTypeCompositeObject;
|
||||
export type IPublicTypePropsMap = IPublicTypeCompositeObject<IPublicTypeNodeData | IPublicTypeNodeData[]>;
|
||||
|
||||
@ -131,6 +131,6 @@ export interface IPublicTypeJSONObject {
|
||||
}
|
||||
|
||||
export type IPublicTypeCompositeArray = IPublicTypeCompositeValue[];
|
||||
export interface IPublicTypeCompositeObject {
|
||||
[key: string]: IPublicTypeCompositeValue;
|
||||
export interface IPublicTypeCompositeObject<T = IPublicTypeCompositeValue> {
|
||||
[key: string]: IPublicTypeCompositeValue | T;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user