簡體   English   中英

Bootstrap突然不適用於我的React JS項目

[英]Bootstrap suddenly not working for my React JS project

藍色的引導程序已停止處理我的項目。 我不知道為什么。

這是我們的package.json:

  {
  "name": "blankets",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "amazon-cognito-identity-js": "^1.26.0",
    "aws-sdk": "^2.151.0",
    "bootstrap": "^4.0.0",
    "jwt-decode": "^2.2.0",
    "prop-types": "^15.6.0",
    "react": "^16.1.1",
    "react-bootstrap": "^0.31.5",
    "react-dom": "^16.1.1",
    "react-router-dom": "^4.2.2",
    "react-scripts": "1.0.17",
    "react-select": "^1.0.0-rc.10"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

這是我們在index.html中的導入

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">

任何幫助/建議/建議將不勝感激! 謝謝!

這個:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">

正在加載最新版本的Bootstrap,即4.0.0。

並且因為Bootstrap 4與Bootstrap 3完全不兼容,這會破壞您的布局。

解:

加載Bootstrap 3的css(以及相應的js)文件,或遷移到Bootstrap 4。

Bootstrap 3鏈接:

https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css

https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM