mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-09 20:52:59 +08:00
feat(data-source): 迭代器容器内容支持显示条件配置
This commit is contained in:
parent
ef04fd31f0
commit
ecfaff2e0d
@ -222,7 +222,7 @@ class DataSourceManager extends EventEmitter {
|
||||
const [dsId, ...keys] = dataSourceField;
|
||||
const ds = this.get(dsId);
|
||||
if (!ds) return items;
|
||||
return compliedIteratorItems(itemData, items, dsId, keys, this.app.platform !== 'editor');
|
||||
return compliedIteratorItems(itemData, items, dsId, keys, this.app.platform === 'editor');
|
||||
}
|
||||
|
||||
public destroy() {
|
||||
|
@ -223,7 +223,7 @@ export const compliedIteratorItems = (
|
||||
return items.map((item) => {
|
||||
const ctxData = createIteratorContentData(itemData, dsId, keys);
|
||||
|
||||
if (condDeps[item.id]?.keys.length) {
|
||||
if (condDeps[item.id]?.keys.length && !inEditor) {
|
||||
item.condResult = compliedConditions(item, ctxData);
|
||||
}
|
||||
|
||||
@ -231,10 +231,6 @@ export const compliedIteratorItems = (
|
||||
return item;
|
||||
}
|
||||
|
||||
if (!inEditor) {
|
||||
item.condResult = compliedConditions(item, itemData);
|
||||
}
|
||||
|
||||
return compiledNode(
|
||||
(value: any) => compiledNodeField(value, ctxData),
|
||||
cloneDeep(item),
|
||||
|
Loading…
x
Reference in New Issue
Block a user