Questions tagged «react-bootstrap»

9
导航栏中的React-Bootstrap链接项
我在使用react-router和react-bootstrap时遇到一些样式问题。下面是代码片段 import { Route, RouteHandler, Link } from 'react-router'; import AuthService from '../services/AuthService' import { Button, Nav, Navbar, NavDropdown, MenuItem, NavItem } from 'react-bootstrap'; <Nav pullRight> <NavItem eventKey={1}> <Link to="home">Home</Link> </NavItem> <NavItem eventKey={2}> <Link to="book">Book Inv</Link> </NavItem> <NavDropdown eventKey={3} title="Authorization" id="basic-nav-dropdown"> <MenuItem eventKey="3.1"> <a href="" onClick={this.logout}>Logout</a> </MenuItem> </NavDropdown> </Nav> 这就是渲染时的样子。 …

6
在reactjs中收听按键文档
我想绑定以在escape按下时关闭活动的反应引导弹出窗口。这是代码 _handleEscKey:function(event){ console.log(event); if(event.keyCode == 27){ this.state.activePopover.hide(); } }, componentWillMount:function(){ BannerDataStore.addChangeListener(this._onchange); document.addEventListener("click", this._handleDocumentClick, false); document.addEventListener("keyPress", this._handleEscKey, false); }, componentWillUnmount: function() { BannerDataStore.removeChangeListener(this._onchange); document.removeEventListener("click", this._handleDocumentClick, false); document.removeEventListener("keyPress", this._handleEscKey, false); }, 但是,当我按任意键时,控制台中都不会记录任何内容。我也尝试在窗口上以及不同情况下使用'keypress','keyup'等来收听,但似乎我做错了。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.