2016-11-16 43 views
-1

我有npminstalled bootstrap-sass「^ 3.3.7」,並reactjs。這足以與BS類一起工作,例如「well」?如何讓引導類在reactjs應用程序中工作?

這是我的組件的一部分:

render() { 
    return (
     <div className="well"> 
      hi from well 

      <button className="btn btn-danger"></button> 
     </div> 
    ); 
} 

我怎樣可以加入我的青菜建bootstrapstyles?

+0

你有沒有試過react-bootstrap? https://react-bootstrap.github.io/getting-started.html。否則,如果您的npm文件中包含bootstrap-sass,我認爲您的當前代碼可以正常工作。如果一切都失敗了,你也可以使用bootstrap cdn鏈接,你的代碼應該可以工作。 – heyitsjhu

+0

如何將reactbootstrap包含在sass中? –

回答

0

有2種方式,你可以去這樣做: -

  • 使用React Bootstrap。但很明顯,這個項目正在開發中,所以在生產中使用這個項目我認爲顯然不是一個好主意。
  • 將bootstrap添加到您的項目中,並在編譯後的bundle.js響應之前,在您的html中導入bootstrap js文件。
相關問題