當我選擇一個檔案時,例如 image2.jpg 我希望沒有檔案選擇的文本更改為檔案名
<input type="file"onChange={this.onChange} value={this.state.allValues.BloodReport} />

我已將完整代碼放入代碼和框中
uj5u.com熱心網友回復:
在沒有 value 屬性的情況下使用它。名稱將自動顯示。
<input type="file"onChange={this.onChange} />
uj5u.com熱心網友回復:
洗掉value從<input type="file" />再試試!
<input
style={styles.cutumbuttons}
type="file"
style={styles.cutumbuttons}
name="ultraSound"
// accept="application/pdf"
onChange={this.onChange}
//value={this.state.allValues.BloodReport}
/>
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/403138.html
標籤:
上一篇:基于反應狀態的div條件渲染
