小编Nov*_*Man的帖子

Bootstrap 不适用于我的 Angular 项目

我已使用以下步骤将引导程序包含到我的 Angular 项目中

  1. 使用 cli 创建角度项目
  2. npm 安装 bootstrap@3 jquery --save
  3. 然后像平常一样将脚本和样式路径添加到我的索引文件中

该样式未应用于我的页面。还有什么我必须做的吗?我正在从索引页添加 HTML 代码片段

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Project</title>
  <script  src="../node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
  <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
  <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap-theme.min.css">
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
    <h1>ewreeew</h1>
    <button class="btn btn-primary">Test Button</button>
  <app-root></app-root>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
版本详细信息为:Angular CLI:6.0.8

节点:8.11.2

操作系统:win32 x64

角度:6.0.5

...动画、常见、编译器、编译器-cli、核心、表单

... http、语言服务、平台浏览器

...平台浏览器动态、路由器

套餐版本

@Angular-devkit/架构师 0.6.8

@Angular-devkit/build-Angular 0.6.8

@Angular-devkit/构建优化器 0.6.8

@Angular-devkit/核心 0.6.8

@angular-devkit/schematics 0.6.8

@角度/cli 6.0.8

@ngtools/webpack 6.0.8

@schematics/角度0.6.8

@schematics/更新0.6.8

rxjs 6.2.1

打字稿 2.7.2

网页包 4.8.3 …

angular-ui-bootstrap angular-cli angular angular6 angular-cli-v6

3
推荐指数
1
解决办法
5428
查看次数