gpt4 book ai didi

css - 在 Sass 文件中写入 CSS 在 Angular 7 中抛出错误

转载 作者:太空宇宙 更新时间:2023-11-03 20:25:22 25 4
gpt4 key购买 nike

我正在尝试在 Angular 7 组件的 sass 文件中编写一个简单的 css 语法,但我遇到了编译错误,如下所示。

enter image description here

sass 文件只包含简单的 css,如图所示

.full-width {
width: 100%;
}

在早期的 Angular 版本中,我没有这样的问题。

最佳答案

根据您的 SCSS 文件的文件扩展名,您实际上使用的是 SASS,这是 SCSS 的旧版本。如 Sass syntax 的文档中所示, SASS 语言使用缩进语法。

来自section on SASS :

The indented syntax supports all the same features as SCSS, but it uses indentation instead of curly braces and semicolons to describe the format of the document.

您应该做的是将该 SCSS 文件的文件扩展名更改为 .scss,或者将 SCSS 语法转换为 SASS。

关于css - 在 Sass 文件中写入 CSS 在 Angular 7 中抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56480030/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com