Angular 物料图像列表错误:@import"@材料/特征目标/功能”等;;
我想在我的角度项目中使用mdc图像列表。我得到一个错误:Angular 物料图像列表错误:@import"@材料/特征目标/功能”等;;,angular,sass,material-components-web,Angular,Sass,Material Components Web,我想在我的角度项目中使用mdc图像列表。我得到一个错误: @import "@material/feature-targeting/functions"; ^ Can't find stylesheet to import. ╷ 21 │ @import "@material/feature-targeting/functions"; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ node_
@import "@material/feature-targeting/functions";
^
Can't find stylesheet to import.
╷
21 │ @import "@material/feature-targeting/functions";
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
node_modules/@material/image-list/_mixins.scss 21:9 @import
node_modules/@material/image-list/mdc-image-list.scss 21:9 @import
stdin 2:9 root stylesheet
我按照这里的安装步骤进行了安装,但仍然出现此错误。我尝试删除节点模块并再次安装npm。我不确定我的sass加载程序是否有问题,因为我使用了材质的布局网格,导入了
@import“@Material/Layout Grid/mdc Layout Grid”代码>并且工作正常。可能会出现什么问题?您需要在物料的节点_模块中的每次导入之前添加~以便它进入@import“@material/feature targeting/functions”;
成为~@material/feature targeting/functions“
并在编译器显示此错误时执行此操作将节点_模块
添加到angular.json
中的样式预处理器选项中,以便可以解析导入路径:
“样式预处理器”:{
“包含路径”:[
“/src/styles”,
“/节点\单元”
]
},
您能提供stackblitz演示吗?