styleUrls ionic - 404(未找到)

时间:2018-04-09 10:59:33

标签: ionic-framework sass

有没有人知道如何解决组件上找不到.scss的404文件:

enter image description here

这是我的.ts文件

我认为这就是你如何连接你的造型 .scss和.ts位于同一个日历/目录中

@Component({
  selector: 'calendar',
  styleUrls: **['calendar.component.scss']**,
  templateUrl: 'calendar.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush
})

有没有其他人偶然发现这个问题。 我试过了:

styleUrls:[' calendar.component.scss'],  styleUrls:[' ./ calendar.component.scss'], 还有:

app.scss中的

,如下所示:

@import '../components/calendar/calendar'
@import '../components/calendar/calendar/calender.component.scss'

所有尝试均未成功。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

离子4:

似乎实际的styleUrls在相对路径方面有些漏洞。 例如,将styleUrls更改为styles

styles: ['favourites.scss']