javascript - 在 ASP Net CORE MVC 项目中使用 Google Material UI
问题描述
如何将 Google Material Icons 添加到 MVC Net Core 项目中?我通过添加所有 zip 文件在我的项目文件夹中按照这些说明进行操作。只是好奇下一步是什么?
https://google.github.io/material-design-icons/
npm install material-design-icons
下面的这个链接已经过时了。
如何在 asp.net mvc 项目中使用 Material-UI
当前使用 MVC Core Net Core 2.2。公司不想应用 CDN URL 路由。
解决方案
如果你曾经npm
安装过,它会创建一个名为node_modules
(可能隐藏在解决方案资源管理器中,点击Show All Files
按钮查看)的文件夹。
您必须编写一些脚本(gulp、grunt 等)来将文件从node_modules
目录移动到wwwroot/lib
文件:
如何使用 ASP.NET Core v2 在 Visual Studio 2017 中安装 font-awesome
如果使用 gulp ,您可以尝试:
gulp.task('copy', ["clean"], function () {
return gulp.src(['./node_modules/material-design-icons/iconfont/*'], {
base: 'node_modules'
}).pipe(gulp.dest('./wwwroot/lib'));
});
并且可以引用 .css 中的 css 文件_Layout.cshtml
。
注意:目前使用库管理器(LibMan)恢复material-design-icons
在我的测试中总是失败。
推荐阅读
- java - Selenium:检查任何时间点存在的元素
- python - 访问 tkinter Python 3 中的顶部窗口面板按钮?(最大化、最小化、关闭)
- jgrasp - 编译器失败,但未检测到错误行
- javascript - 生成具有相关概率的随机字符串
- python - 从字符串创建熊猫数据框
- visual-studio-2017 - BindingNavigator:AddItem 按钮保存表单,但不清除新记录的表单
- c# - While(true) 循环停止?
- ios - IOS谷歌地图
- dart - 类重置变量
- vb.net - VB.net 使用 Between Dates 的 where 条件来打开 Report