mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
fix: 以节点id作为key,修复拖拽、增删时组件频繁卸载的问题
This commit is contained in:
parent
8fd8e7d45a
commit
c8e2f9d8ef
@ -372,7 +372,7 @@ export default function baseRenererFactory() {
|
||||
}
|
||||
if (Array.isArray(schema)) {
|
||||
if (schema.length === 1) return this.__createVirtualDom(schema[0], self, parentInfo);
|
||||
return schema.map((item, idy) => this.__createVirtualDom(item, self, parentInfo, item?.__ctx?.lceKey ? '' : idy));
|
||||
return schema.map((item, idy) => this.__createVirtualDom(item, self, parentInfo, item?.__ctx?.lceKey ? '' : String(idy)));
|
||||
}
|
||||
// FIXME
|
||||
const _children = this.getSchemaChildren(schema);
|
||||
@ -484,6 +484,7 @@ export default function baseRenererFactory() {
|
||||
}
|
||||
props.key = props.key || `${schema.__ctx.lceKey}_${schema.__ctx.idx || 0}_${idx !== undefined ? idx : ''}`;
|
||||
} else if (typeof idx === 'number' && !props.key) {
|
||||
// 仅当循环场景走这里
|
||||
props.key = idx;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user