我有这个功能:
getFace(/* string */ face_name,/* int */ w,/* int */ h,/* int */ z) {
const am = this.props.assetsManager;
return {
backgroundSize: 'contain',position: 'absolute',width: `${w}px`,height: `${h}px`,zIndex: z
};
如果face_name
是face2
,我需要返回其他样式,即backroundColor: red
如何为条件语句添加条件?