forked from p96170835/amis
公式如果配置了自定义条件, didmount 也应该判断
This commit is contained in:
parent
782a767943
commit
c0de429521
|
@ -12,10 +12,12 @@ export interface FormulaProps extends FormControlProps {
|
|||
|
||||
export default class FormulaControl extends React.Component<FormControlProps, any> {
|
||||
componentDidMount() {
|
||||
const {formula, data, setPrinstineValue, initSet} = this.props;
|
||||
const {formula, data, setPrinstineValue, initSet, condition} = this.props;
|
||||
|
||||
if (!formula || initSet === false) {
|
||||
return;
|
||||
} else if (condition && !~condition.indexOf('$') && !~condition.indexOf('<%') && !evalJS(condition, data as object)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const result: any = evalJS(formula, data as object);
|
||||
|
|
Loading…
Reference in New Issue