【问题标题】:Angular application stylingAngular 应用程序样式
【发布时间】:2017-12-04 15:38:18
【问题描述】:

我正在前端构建一个带有 Angular 和引导程序的应用程序,基本上我有一个登录页面、登录和登录后的仪表板。

问题是关于如何处理应用程序之间的样式表。着陆页和仪表板的样式完全不同。登陆页面看起来像this,仪表板看起来像this image

我已经制作了不同的 css 文件来处理应用程序的每个部分,现在我正在尝试加入 Angular 应用程序,但是如果我将这些 css 文件添加到 angular-cli.json,角度将同时添加到索引中,我将有一些类冲突,并且从仪表板登陆的文件,反之亦然。

对于处理这种情况的任何帮助,我将不胜感激。

【问题讨论】:

    标签: angular angular-ui angular-bootstrap


    【解决方案1】:

    通常你的组件会是这样的

    @Component({
      selector: 'app-component-uno',
      templateUrl: './app-component-uno.html',
      styleUrls:['./app-component-uno.css'] //<--this
    }.....)
    

    css 属于组件,没有冲突。解决冲突的唯一方法是使用封装:ViewEncapsulation.None,

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-12
      • 2018-02-19
      • 1970-01-01
      • 2015-02-26
      • 1970-01-01
      • 2019-04-07
      相关资源
      最近更新 更多