简体   繁体   English

dist 文件夹的正确路径

[英]Correct path to dist-folder

I was trying to use, with angular:我正在尝试使用 angular:

https://material.io/develop/web/components/drawers/ https://material.io/develop/web/components/drawers/

I realized I can not use我意识到我不能使用

@import "@material/drawer/mdc-drawer";
@import "@material/list/mdc-list";

Because I use CSS.因为我用的是 CSS。

To make it work, I decided to put为了让它工作,我决定把

styleUrls: [
    '...',
    "~@material/drawer/dist/mdc.drawer.min.css"
]

This does not work, he can not find it.这不行,他找不到。

What is the right way?什么是正确的方法?

Both do not work, this is like the image for the Path:两者都不起作用,这就像路径的图像:

https://imgur.com/a/Cvu9M0T https://imgur.com/a/Cvu9M0T

"stylePreprocessorOptions": {
   "includePaths": [
      "./node_modules"
]}

Just include node_modules path into angular.json file.只需将 node_modules 路径包含到 angular.json 文件中。

Please try to add below请尝试在下面添加

styleUrls: [
    '...',
    "../../node_modules/@material/drawer/dist/mdc.drawer.min.css"
]

please refer this post if it is helpful.如果有帮助,请参考这篇文章。 Angular2: How to import a stylesheet from node_modules? Angular2:如何从 node_modules 导入样式表?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM