繁体   English   中英

在办公室 ui 结构中,如何在单击按钮时获得默认选定值

[英]In office ui fabric how can I get default selected value on button click

在我的应用程序中,我使用了 office ui fabric react 下拉控件,当我单击按钮时,我需要检查它是否为空?

public options = [
    { key: 'Employee Name', text: 'Employee Name' },
    { key: 'Employee ID', text: 'Employee ID' },
    { key: 'Department', text: 'Department' }
];

<Dropdown defaultSelectedKey="Employee Name" options={this.options} onChange={this._onChange} />
<input type="button" value="Get Data" id="btnSub" onClick={() => this.readItem()} />


private readItem(): void {
    what I need to do here
}

从事件目标中读取值。

(e) => this.readItem(e.value.target)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM