[問題] 請問如何用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