簡體   English   中英

如何識別所選的主要文本 <MenuItem/> 在ReactJS Material-UI中?

[英]How to recognize the primary text of selected <MenuItem/> in ReactJS Material-UI?

我正在使用http://www.material-ui.com/#/components/dropdown-menu ,我想控制日志選擇<MenuItem/>的primaryText。 我怎么能這樣做?

使用onChange(event: object, key: number, value: any)函數。

事件對象具有有關所選項的信息。

你可以嘗試

console.log(event.target.textContent)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM