feat: setting-pane 新增removeProp 函数

This commit is contained in:
zude.hzd 2020-08-19 11:05:33 +08:00
parent 8fd77df2a0
commit b97c80746c
2 changed files with 6 additions and 2 deletions

View File

@ -55,8 +55,8 @@ export default class FunctionSetter extends PureComponent<FunctionSetterProps, {
} }
removeFunctionBind = () => { removeFunctionBind = () => {
const { field ,onChange} = this.props; const { field ,removeProp} = this.props;
field.parent.clearPropValue(field.name); removeProp();
} }
parseFunctionName = (functionString: String) => { parseFunctionName = (functionString: String) => {

View File

@ -142,6 +142,10 @@ class SettingFieldView extends Component<{ field: SettingField }> {
}); });
field.setValue(value); field.setValue(value);
}, },
removeProp:()=>{
field.parent.clearPropValue(field.name);
}
}), }),
extraProps.forceInline ? 'plain' : extraProps.display, extraProps.forceInline ? 'plain' : extraProps.display,
); );