问题描述
我有一个反应表,可用于添加和编辑数据。 尝试编辑记录时,除自动完成记录外,我的所有数据均正确显示在文本字段中,我知道在道具中进行验证时会正确携带数据。
使用以下代码,我尝试过的是,如果道具中的id为0,即它是一条新记录,则采用自动完成值,如果不采用我带入道具的值,但是文本框仍显示为空白,可能是什么问题?
<Autocomplete}
{...defaultProps}
id="TypeAuto"
autoComplete
includeInputInList
value={(props.theregistry.id===0) ? dataAutoComplete.TypeAuto : props.theregistry.tipos}
onChange={(event,newVal)=>handleChangeAutoType({target:{name:"TypeAuto",value: newVal
}
})}
renderInput={params => (
<TextField {...params} label="Types" margin="normal" variant="outlined" fullWidth="true" />
)}
/>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)