fix: 🐛 添加 loop 和 condition 的判断

This commit is contained in:
YJSON 2020-08-18 22:01:38 +08:00
parent a01e4b1963
commit b521ebead1

View File

@ -135,7 +135,7 @@ export default function(metadata: TransformedComponentMetadata): TransformedComp
// if (item.type === 'group' && (item.title === '高级' || item.title?.label === '高级')) {
// advanceGroup = item.items || [];
// propsGroup.splice(l, 1);
// }
// }
if (item.name === '__style__' || item.name === 'containerStyle' || item.name === 'pageStyle') {
propsGroup.splice(l, 1);
stylesGroup.push(item);
@ -262,22 +262,26 @@ export default function(metadata: TransformedComponentMetadata): TransformedComp
},
})
}
advanceGroup.push({
name: 'key',
title: {
label: '渲染唯一标识key',
tip: '搭配「条件渲染」或「循环渲染」时使用,和 react 组件中的 key 原理相同,点击查看帮助',
docUrl: 'https://yuque.antfin-inc.com/legao/help3.0/ca5in7',
},
setter: [{
componentName: 'StringSetter',
}, {
componentName: 'VariableSetter'
}],
extraProps: {
display: 'block',
},
},)
if(supports.condition !== false || supports.loop !== false) {
advanceGroup.push({
name: 'key',
title: {
label: '渲染唯一标识key',
tip: '搭配「条件渲染」或「循环渲染」时使用,和 react 组件中的 key 原理相同,点击查看帮助',
docUrl: 'https://yuque.antfin-inc.com/legao/help3.0/ca5in7',
},
setter: [{
componentName: 'StringSetter',
}, {
componentName: 'VariableSetter'
}],
extraProps: {
display: 'block',
},
},)
}
}
if (advanceGroup.length > 0) {
combined.push({