React-bootstrap button bsStyle

心已入冬 提交于 2019-12-04 06:23:54

问题


Ok, I am missing something obviously but cannot figure it now.

import React from 'react';
import {Button} from 'react-bootstrap';
let App=React.createClass({

    render: function () {
        return (
            <div>
            <Button bsStyle="primary" bsSize="large">Primary</Button>
            <Button bsStyle="success">Success</Button>
            <Button>Sketo</Button>
             </div>
        );
    }

});

React.render(<App />, document.getElementById('app'));

I can see the buttons but there are not styles applied to them. Thay are all plain as the third one. Grey and small. What am I missing?


回答1:


I think the App component works OK~, it has no problem when I test. Maybe you miss one thing: To link in the CSS of Bootstrap. Try to add a linking stylesheet inside the head of the HTML.



来源:https://stackoverflow.com/questions/33302202/react-bootstrap-button-bsstyle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!