Bootstrap卡组件未在React中呈现

时间:2016-09-25 04:22:48

标签: css twitter-bootstrap reactjs meteor

我正在使用bootstrap来设计我的反应应用程序。这在大多数时候都很有效。但由于某种原因,我无法正确呈现卡组件。其他引导程序组件(如Navbar和表单)运行良好 - 它只是卡组件的错误行为。

除了将类重命名为className之外,渲染卡还需要什么?完整的代码如下。非常感谢任何见解!

import React from 'react'
import ReactDOM from 'react-dom';
import TrackerReact from 'meteor/ultimatejs:tracker-react';
export default class CardCollectionWrapper extends TrackerReact(React.Component) {


    constructor() {
    super();

    this.state = {
    }
    }

    componentWillMount() {
    }

    componentWillUnmount() {
    }

    loadMore() {
    }

    sortBy(){
    }

    render() {
    return(
      <div className="card-deck-wrapper">
      <div className ="container">
        <div className="card-deck">
          <div className="card">
            <img className="card-img-top" src="/images/wire240.jpeg" alt="Card image cap"/>
            <div className="card-block">
              <h4 className="card-title">Card title</h4>
              <p className="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
              <p className="card-text"><small className="text-muted">Last updated 3 mins ago</small></p>
            </div>
          </div>
          <div className="card">
            <img className="card-img-top" src="/images/wireframe.png" alt="Card image cap"/>
            <div className="card-block">
              <h4 className="card-title">Card title</h4>
              <p className="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
              <p className="card-text"><small className="text-muted">Last updated 3 mins ago</small></p>
            </div>
          </div>
          <div className="card">
            <img className="card-img-top" src="/images/wireframe.png" alt="Card image cap"/>
            <div className="card-block">
              <h4 className="card-title">Card title</h4>
              <p className="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
              <p className="card-text"><small className="text-muted">Last updated 3 mins ago</small></p>
            </div>
          </div>
        </div>
      </div>
    </div>
    )}}

1 个答案:

答案 0 :(得分:0)

我正在使用Bootstrap版本3 meteor add twbs:bootstrap,它不包含卡组件。谢谢杨顺