1
我在我的React應用程序中使用了antd設計。antd design選擇佔位符問題
這裏就是我所面臨的問題的代碼片段:
<Select
showSearch
optionFilterProp = "children"
placeholder = "Select Company"
value = "{this.state.company}"
name = "company"
onSelect = "{this.handleCompanyChange}"
>
現在它顯示選擇,如果this.state.company
不null
正確的值。但是,如果this.state.company
是empty
或null
,佔位符不顯示。
如何解決此問題,以便佔位符在value
爲空時出現?
你的意思是這樣的:this.state.company = undefined? –