仅当组件具有向下传递的关联属性时,才向组件添加道具

时间:2019-05-02 19:06:11

标签: reactjs material-ui

我有一个Select组件,仅当它从父对象传递下来时,才需要附加一个图标作为输入装饰。

from numpy import *
x1 = 1
x2 = 50
x3 = 1
def f(x1,x2,x3): 
    y = 0
    for i in range(1,100):
        u = (25+(-50*log(0.01*i))**(2/3))
        print("u:",u)
        print("y:",y)
        print("x1:",x1)
        print("x2:",x2)
        print("x3:",x3)
        print("calc:",(complex(u - x2)))
        y = y + (-0.01*i + exp(-(1/x1)*(complex(u - x2)**x3))**2)


        #print(f'y{i} : {y}')
    return y

y1 = f(25,50,1.25)
y2 = f(26,51,2.25)


print(f'y1: {y1}')
print(f'y2: {y2}')

它只会不断出现意外的令牌错误。正确的做法是什么?

1 个答案:

答案 0 :(得分:1)

尝试:

<Select
    className={classes.select}
    native
    input={
        <FilledInput 
            {...icon ? {
                startAdornment: (
                <InputAdornment position="start">
                    <AccountCircle />
                </InputAdornment>
                )
            } : {}}
            className={classes.inputContainer} 
            name={this.props.label} 
            id={this.props.id}
        />
    }
>