React-bootstrap导航栏无法正确显示

时间:2018-04-09 05:13:24

标签: reactjs navbar react-bootstrap

我的NavBar NavItem垂直显示,但我试图将其水平显示。我不知道我搞砸了哪里。如果您有任何想法,请告诉我。谢谢! 这是我的代码:

import React, { Component } from 'react';
import { Navbar, Nav, NavItem } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import './CustomNavbar.css'

export default class CustomNavbar extends Component{
  render(){
    return(
  <Navbar inverse collapseOnSelect>
      <Navbar.Header>
          <Navbar.Brand>
            <Link to='/'>Tsarong </Link>
          </Navbar.Brand>
            <Navbar.Toggle />
          </Navbar.Header>
      <Navbar.Collapse>

      <Nav>
            <NavItem eventKey={1} href="/">
              Home
            </NavItem>
            <NavItem eventKey={2} href="/main">
              Main
            </NavItem>
            <NavItem eventKey={3} href="/contact">
              Contact
            </NavItem>
            <NavItem eventKey={4} href="/about">
              About
            </NavItem>
            <NavItem eventKey={5} componentClass={Link} to="/topics">
              Topic
            </NavItem>
      </Nav>
      </Navbar.Collapse>
  </Navbar>
    )
  }
}

非常感谢您的时间!

1 个答案:

答案 0 :(得分:2)

Executors.newSingleThreadScheduledExecutor()