[问题] 请问如何用React.js 使用Google Fonts?

楼主: iceleaf (我行我素 我型我塑)   2016-11-24 12:12:07
最近开始学习React.js与webpack,
想请问如果我想要使用Google Fonts网站上的字型到React.js内,
https://fonts.google.com/specimen/Roboto
我该怎么做呢?
目前是尝试在<head>内加载,
<head>
<link href="https://fonts.googleapis.com/css?family=Bungee+Inline|Roboto"
rel="stylesheet">
<style>
body{
font-family: 'Roboto', sans-serif;
}
</style>
但没有效果
也有尝试在webpack打包前, 在module内写CSS字体样式
但也是没效果,
想请问我该怎么做呢?
React.js新手需要版上的援手, 感激不尽...
作者: sullivan1982 (sullivan1982)   2016-11-30 18:56:00
基本上react只会换掉<div>,你其他写在index.html的东西都会还在

Links booklink

Contact Us: admin [ a t ] ucptt.com