快速上手react-bootstrap

快速上手react-bootstrap

安装

npm install react-bootstrap@next bootstrap@5.0.2

# 如果有yarn,可以直接:
yarn add react-bootstrap@next bootstrap@5.0.2 

样式引入

直接在 index.js 入口文件中引入:

import 'bootstrap/dist/css/bootstrap.min.css';

使用

最新网址:

https://react-bootstrap.github.io/components/alerts/

中文参考网址:

http://react.tgwoo.com/components.html#page-layout

推荐相互对照查看


废弃了的属性值: bsStyle,改变为:variant

用法

直接在 index.js 入口文件中引入:

import 'bootstrap/dist/css/bootstrap.min.css'; 

导入相关组件:

import {
    
     Button } from 'react-bootstrap';
<Button variant="primary">Primary</Button> 

总之,要使用什么组件就在组件上方解构 react-bootstrap 来引入。

猜你喜欢

转载自blog.csdn.net/m0_46672781/article/details/127115455
今日推荐