antDesign 中input如何使用ref獲取內容


其他input使用ref,獲取輸入框內容為:

 

const image = this.refs.image.value;
console.log(image);

文件內容

const image_urls = this.refs.image_urls.files[0];
console.log(image_urls);

 

而antD中是這樣的:

const image = this.refs.image.input.value;
console.log(image);

文件內容
const image_url = this.refs.image_url.input.files[0];
console.log(image_url);



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM