npm安装后如何引用Google Material-Design-Icons? [英] How do I reference Google Material-Design-Icons after npm install?

查看:91
本文介绍了npm安装后如何引用Google Material-Design-Icons?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,在完成 npm install material-design-icons 之后,如何在我的 React 应用程序中使用它们?

So after doing npm install material-design-icons, how do I use them in my React application?

此处包含的方法不包含 npm 方法.

The methods included here doesn't include the npm method.

推荐答案

这是您可以在styles.css中引用它的方式:

This is the way you can reference it (in your styles.css):

@import '~material-design-icons/iconfont/material-icons.css';

要使用它:

<i class="material-icons">cloud_upload</i>

这篇关于npm安装后如何引用Google Material-Design-Icons?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆