【问题标题】:scss not compiled from app directory Angular 6+scss 不是从应用程序目录 Angular 6+ 编译的
【发布时间】:2019-03-26 19:45:03
【问题描述】:

您好,我刚刚使用命令ng new my-sassy-app --style=scss 项目创建成功创建了测试角度应用程序,但是scss 文件没有从应用程序目录编译,例如:当我在app.component.scss 中编写body {background: red} 时,但是当我编写相同的代码时在 src/style.scss scss 编译好。 不知道是什么问题。

截图无效

我输入相同内容时的工作截图 src/style.scss

【问题讨论】:

  • 你是否在 app.component.ts 样式数组中添加了这个 app.component.scss?
  • 是的当然是默认添加的

标签: css angular sass angular2-template


【解决方案1】:

确保在 angular.json 中有该行。注意风格:“scss

  "schematics": {
    "@schematics/angular:component": {
      "style": "scss"
    }
  },

【讨论】:

  • 你的版本旧了,现在"style":"scss""styleext":"scss"
猜你喜欢
  • 2018-02-17
  • 2018-12-04
  • 2016-12-07
  • 1970-01-01
  • 2018-03-16
  • 1970-01-01
  • 1970-01-01
  • 2011-05-08
  • 2021-03-13
相关资源
最近更新 更多