加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

将scss文件添加到Stackblitz

发布时间:2020-12-17 07:56:24 所属栏目:安全 来源:网络整理
导读:你能告诉我如何将scss文件添加到stackblitz吗?我试过了.但它不起作用.请看到并告诉我. 我试过添加home.html 这是项目: stackblitz Scss应该在stackblitz中工作: @Component({ selector: 'page-home',templateUrl: 'home.html',styleUrls: [ './home.scss'
你能告诉我如何将scss文件添加到stackblitz吗?我试过了.但它不起作用.请看到并告诉我.

我试过添加home.html

这是项目:stackblitz

Scss应该在stackblitz中工作:
@Component({
  selector: 'page-home',templateUrl: 'home.html',styleUrls: [ './home.scss' ] <== add this
})
export class HomePage {

风格如

page-home {
 .buttoncls {

默认封装(ViewEncapsulation.Emulated)不适用于你,因为page-home不是主组件模板的一部分,而angular将类似[_ngcontent-c0]的属性添加到样式中.

所以我们可以将page-home更改为ion-list,看看它是如何工作的:

Stackblitz Example (ViewEncapsulation.Emulated)

但我们可以禁用封装:

encapsulation: ViewEncapsulation.None

Stackblitz Example (ViewEncapsulation.None)

另见这个主题

https://github.com/stackblitz/core/issues/1

正如EricSimons在9天前评论过的那样

Hey all! We just shipped SASS and LESS support,and we also support the angular-cli.json config too

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读