Mor*_*len 5 reactjs react-bootstrap
我正在尝试使用 react-bootstrap 来设计网页样式。
包.json
{
"name": "chrome-ui",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-scripts": "1.0.16"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"react-bootstrap": "^0.31.5"
}
}
Run Code Online (Sandbox Code Playgroud)
应用程序.js
import React from 'react';
import { Button } from 'react-bootstrap'
function CheckState(props){
function handleClick(e){
console.log(props.state)
}
return(
<Button bsStyle="primary" onClick={handleClick}>Click for state</Button>
)
}
Run Code Online (Sandbox Code Playgroud)
但是,这是我刷新时在网页上看到的内容:
看起来好像没有添加样式。我究竟做错了什么?
小智 10
添加导入“bootstrap/dist/css/bootstrap.css”;在你的 index.js
| 归档时间: |
|
| 查看次数: |
5694 次 |
| 最近记录: |