简体   繁体   English

react-bootstrap选项卡下划线

[英]react-bootstrap Tabs have underline

I'm using React-Bootstrap framework, and I ran into an issue with the Tabs/Tab components not displaying correctly. 我正在使用React-Bootstrap框架,并且遇到Tabs / Tab组件无法正确显示的问题。 There's an underline under the active tab: 活动标签下有一个下划线:

imgur.com imgur.com

Here's the render code: 这是渲染代码:

const React = require('react');
const { Tabs, Tab } = require('react-bootstrap');

const Account = React.createClass({
    getInitialState() {
        return {
            activeTab: 1,
        };
    },
    componentWillMount() {
        const section = this.props.params.section ? this.props.params.section : 'contact';
        let activeTab;

        switch (section) {
            case 'contact':
                activeTab = 1;
                break;
            case 'security':
                activeTab = 2;
                break;
            case 'notifications':
                activeTab = 3;
                break;
            default:
                // default to contact tab
                activeTab = 1;
                break;
        }

        this.setState({ activeTab });
    },
    render() {
        return (
            <div className="u__narrow">
                <h1 className="__page-title">Your Account</h1>
                <Tabs id="accountSections" activeKey={this.state.activeTab} onSelect={key => this.setState({activeTab: key })}>
                    <Tab eventKey={1} title="Contact Info">
                        <ContactInfo />
                    </Tab>
                    <Tab eventKey={2} title="Password & Security">
                        <Security />
                    </Tab>
                    <Tab eventKey={3} title="Email Notifications">
                        <Notifications />
                    </Tab>
                </Tabs>
            </div>
        );
    },
});

module.exports = Account;

I'm doing the exact thing as the documentation, but I'm encountering the underline issue 我正在做与文档一样的事情,但是遇到了下划线问题

looks like you don't have the bootstrap css linked in your page. 看起来您的页面中没有链接引导CSS。 See teh stylesheets section on the documention, React Bootstrap doesn't include any css oyu need to bring it yourself. 参见文档中的样式表部分,React Bootstrap不包含任何os需要自己携带的css oyu。 http://react-bootstrap.github.io/getting-started.html http://react-bootstrap.github.io/getting-started.html

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

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