前端|vue+Material 中Material的字体图标使用教程


vue+Material 中Material的字体图标使用教程

    • 问题
    • 第一步:
    • 第二步(测试):

问题 我找了很久没有找到npm配置的包,官方提供的文档安装之后也没什么用
前端|vue+Material 中Material的字体图标使用教程
文章图片

还是我才疏学浅,不会用吧,下载下来之后继续引入还是没有效果,在查阅了文档之后,终于实现了,下面就直接上教程吧
第一步: 在你的index.html上加入这个外部包(这个方法确实不好,但是我也着实是没有找到其他的方法了)
前端|vue+Material 中Material的字体图标使用教程
文章图片


或者在你的重置样式表中加入这段代码(其实就是这个外部链接的代码)
//Material字体图标 @font-face { font-family: 'Material Icons'; font-style: normal; font-weight: 400; src: url(https://fonts-gstatic.proxy.ustclug.org/s/materialicons/v45/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2'); }.material-icons { font-family: 'Material Icons'; font-weight: normal; font-style: normal; font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr; -webkit-font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased; }

然后就可以使用了。
第二步(测试): 【前端|vue+Material 中Material的字体图标使用教程】支持两种调用方法,如下可任选,material官方字体图标库地址.
favorite account_balance_wallet

    推荐阅读