反应引导按钮 bsStyle [英] React-bootstrap button bsStyle

查看:37
本文介绍了反应引导按钮 bsStyle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我显然遗漏了一些东西,但现在无法弄清楚.

从'react'导入React;从'react-bootstrap'导入{Button};让 App=React.createClass({渲染:函数(){返回 (<div><Button bsStyle="primary" bsSize="large">Primary</Button><Button bsStyle="success">Success</Button><Button>Sketo</Button>

);}});React.render(, document.getElementById('app'));

我可以看到按钮,但没有应用到它们的样式.作为第三个,它们都很简单.灰色和小.我错过了什么?

解决方案

我觉得 App 组件还可以~,我测试没问题.也许你错过了一件事:在 Bootstrap 的 CSS 中链接.尝试在 HTML 的头部添加一个链接样式表.

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?

解决方案

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.

这篇关于反应引导按钮 bsStyle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆