mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 17:08:14 +00:00
fix: condition增加异常保护
This commit is contained in:
parent
7171aa218d
commit
83243686f5
@ -18,7 +18,13 @@ class SettingFieldView extends Component<{ field: SettingField }> {
|
||||
const { field } = this.props;
|
||||
const { extraProps } = field;
|
||||
const { condition, defaultValue, display } = extraProps;
|
||||
const visible = field.isSingle && typeof condition === 'function' ? condition(field) !== false : true;
|
||||
let visible;
|
||||
try {
|
||||
visible = field.isSingle && typeof condition === 'function' ? condition(field) !== false : true;
|
||||
} catch (error) {
|
||||
console.error('exception when condition (hidden) is excuted', error);
|
||||
}
|
||||
|
||||
if (!visible) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user