组件文件夹中的component.scss不起作用 [英] component.scss inside component folder does not work
本文介绍了组件文件夹中的component.scss不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我将样式代码放入 component.scss
中时,但这不会影响所引用的目标,但是,当我将样式代码置于 src/scss/style.scss
上时它完美地工作.有谁知道这是什么问题?
When I put styles code in component.scss
, but it does not affect the referred target, however when I put style code on src/scss/style.scss
it works perfectly. Does anyone know what is the problem?
如果缺乏技术知识,请参考一些学习材料.
If it is lack of technical knowledge, please reference me some material to study.
推荐答案
在组件中,注意提供的StyleUrl:
In the component, watch out what is given as the StyleUrl:
@Component({
selector: 'app-something',
templateUrl: './something.component.html',
styleUrls: ['./something.component.scss']
})
也许您的语法不好,或者您指的是一个简单的 something.component.** css **
而不是 .scss
文件.
Maybe your syntax is bad, or you are referring to a simple something.component.**css**
instead of .scss
file.
这篇关于组件文件夹中的component.scss不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文