Bootstrap版本的问题,从bootstrap3迁移到boostrap4

时间:2019-01-08 11:36:50

标签: angular typescript twitter-bootstrap-3 bootstrap-4 ngx-bootstrap

我首先安装了引导程序版本"bootstrap": "^3.3.7",,一切正常。但我无法使用卡。

示例:

<div class="card" style="width: 18rem;">
  <img class="card-img-top" src="..." alt="Card image cap">
  <div class="card-body">
    <h5 class="card-title">Card title</h5>
    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
</div>

我尝试打开Bootstrap 4版本"bootstrap": "4.1.1",,但没有任何改变。这是我的angular-cli.json中的样式:

"styles": [
            "../node_modules/bootstrap/dist/css/bootstrap.min.css",
            "styles.css"
        ],

我想提到的是,我在弹出窗口中使用了ngx-bootstrap,它的工作原理很好。 我的package.json

{
    "name": "ui",
    "version": "0.0.0",
    "license": "MIT",
    "scripts": {
        "ng": "ng",
        "start": "ng serve",
        "build": "ng build --prod",
        "test": "ng test",
        "lint": "ng lint",
        "e2e": "ng e2e"
    },
    "private": true,
    "dependencies": {
        "@angular/animations": "5.2.0",
        "@angular/common": "5.2.0",
        "@angular/compiler": "5.2.0",
        "@angular/core": "5.2.0",
        "@angular/forms": "5.2.0",
        "@angular/http": "5.2.11",
        "@angular/platform-browser": "5.2.0",
        "@angular/platform-browser-dynamic": "5.2.0",
        "@angular/router": "5.2.0",
        "bootstrap": "4.1.1",
        "core-js": "2.4.1",
        "jquery": "3.3.1",
        "ngx-bootstrap": "^3.0.1",
        "popper.js": "^1.14.3",
        "protractor-jasmine2-html-reporter": "0.0.7",
        "protractor-jasmine2-reporter": "^1.1.0",
        "protractor-jasmine2-screenshot-reporter": "^0.5.0",
        "rxjs": "5.5.6",
        "zone.js": "0.8.19"
    },
    "devDependencies": {
        "@angular/cli": "1.7.3",
        "@angular/compiler-cli": "5.2.0",
        "@angular/language-service": "5.2.0",
        "@types/jasmine": "2.8.3",
        "@types/jasminewd2": "2.0.2",
        "@types/node": "6.0.60",
        "codelyzer": "4.0.1",
        "jasmine-core": "2.8.0",
        "jasmine-spec-reporter": "4.2.1",
        "karma": "2.0.2",
        "karma-chrome-launcher": "2.2.0",
        "karma-coverage-istanbul-reporter": "1.2.1",
        "karma-jasmine": "1.1.0",
        "karma-jasmine-html-reporter": "0.2.2",
        "protractor": "5.3.2",
        "ts-node": "4.1.0",
        "tslint": "5.9.1",
        "typescript": "2.5.3"
    }
}

该卡正常工作后,我试图在bootstrap中添加index.html链接,但弹出窗口无效。

引导程序链接:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">

有人知道我在哪里犯错了吗?

1 个答案:

答案 0 :(得分:0)

对于引导程序弹出窗口,模态,轮播等,您需要链接引导程序js脚本