如何将 Google Material 图标添加到 MVC Net Core 元素中? 我按照这些说明在我的元素文件夹中添加了所有 zip 文件。只是好奇下一步是什么?
https://google.github.io/material-design-icons/
npm install material-design-icons
下面的链接已过时。
How to use Material-UI in asp.net mvc project
目前使用MVC Core Net Core 2.2.公司不想申请CDN URL路由。
最佳答案
如果您使用 npm
安装,它会创建一个名为 node_modules
的文件夹(可能隐藏在 Solution Explorer 中,单击 Show All Files
按钮检查它)。
您必须编写一些脚本(gulp、grunt 等)将文件从 node_modules
目录移动到 wwwroot/lib
文件:
How to use npm with ASP.NET Core
How to install font-awesome in Visual Studio 2017 using ASP.NET Core v2
如果使用 gulp ,你可以试试:
gulp.task('copy', ["clean"], function () {
return gulp.src(['./node_modules/material-design-icons/iconfont/*'], {
base: 'node_modules'
}).pipe(gulp.dest('./wwwroot/lib'));
});
并且可以引用_Layout.cshtml
中的css文件。
注意:目前使用Library Manager(LibMan)恢复material-design-icons
在我的测试中总是失败。
关于javascript - 在 ASP Net CORE MVC 元素中使用 Google Material UI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57172304/