一、React中使用jquery
1,在package.json里添加依赖
2,安装jquery:
npm install jquery --save
或npm install
3,index.js中将jquery作为模块引入,就可以使用了
二、React中使用bootstrap
方法1:
1,执行npm install bootstrap --save
2,index.js中引用bootstrap,例如:
import 'bootstrap/dist/css/bootstrap.css';
即可使用bootstrap样式,如添加<button class="btn btn-default" type="submit">Button</button>
其他使用方式:
引用:import bootcss from 'bootstrap/dist/css/bootstrap.css'
使用:<button className={bootcss.btn, bootcss['btn-primary']}>按钮</button>
方法2:使用react-bootstrap
执行npm install react-bootstrap --save
引用:import { Navbar, Jumbotron, Button } from 'react-bootstrap';
import { Button } from 'react-bootstrap';
使用:参考https://www.jianshu.com/p/be2faca62ec2
http://www.php.cn/js-tutorial-388942.html