简体   繁体   English

React-Bootstrap中的卡片

[英]Cards in React-Bootstrap

Are Cards added to React-Bootstrap yet? 卡已经添加到React-Bootstrap了吗?

Or is there any other undocumented way of adding it? 还是有其他未记录的添加方式?

What I am thinking of right now is -> className = 'bootstrap card class syntax' , but I guess, it won't work because it won't recognise it. 我现在想的是-> className = 'bootstrap card class syntax' ,但是我想它不会起作用,因为它无法识别它。

Sort of found the answer, but it doesn't go by the name of card 找到了答案,但并没有按card名显示

You can use <Thumbnail> , it gives the same feel as that of a card. 您可以使用<Thumbnail> ,它具有与卡片相同的感觉。

Bootstrap classes can be used the same way in react like in any non -react project, even without the use of react-bootstrap . 可以像在任何反应项目中一样,以相同的方式在反应中使用Bootstrap类,即使不使用react-bootstrap It can be imported as a CDN in your index.html file... 它可以作为CDN导入到您的index.html文件中...

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

... or it can also be saved locally and imported that way. ...或者也可以将其保存在本地并以这种方式导入。 Or you can configure webpack to import css files directly into your project. 或者,您可以配置webpack将css文件直接导入到项目中。

You'd just have to make sure to use className= instead of class= , but otherwise, it works exactly the same way. 您只需要确保使用className=而不是class= ,但是否则,它的工作方式完全相同。

<div className="col-xs-12 well"></div>

react-bootstrap is an add-on that provides components that do the same thing. react-bootstrap是一个附加组件,提供执行相同操作的组件。 So, even if it's not in react-bootstrap yet, you can still use the functionality, but just as a straight css class. 因此,即使它还没有在react-bootstrap中,您仍然可以使用该功能,但是就像直接使用CSS类一样。

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

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