mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-23 09:58:12 +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 { field } = this.props;
|
||||||
const { extraProps } = field;
|
const { extraProps } = field;
|
||||||
const { condition, defaultValue, display } = extraProps;
|
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) {
|
if (!visible) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user