【问题标题】:Problem with version of Bootstrap, migration from bootstrap3 to boostrap4Bootstrap 版本问题,从 bootstrap 3 迁移到 bootstrap 4
【发布时间】:2019-06-03 02:23:25
【问题描述】:

我首先安装了引导版本"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"
    }
}

我尝试在我的index.html 中添加bootstrap 链接,之后卡可以使用,但我的弹出窗口无法正常工作。

引导链接:

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

有谁知道我哪里出错了?

【问题讨论】:

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


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2017-02-08
    • 2021-07-07
    • 2021-09-03
    • 2020-02-11
    • 2018-07-15
    • 1970-01-01
    • 2017-01-07
    • 2021-05-23
    • 2019-02-14
    相关资源
    最近更新 更多