fix font-custom

This commit is contained in:
tangly1024
2022-12-16 10:33:32 +08:00
parent 4e99df18b5
commit 88118e0fb7
3 changed files with 9 additions and 12 deletions

View File

@@ -49,9 +49,9 @@ const MyApp = ({ Component, pageProps }) => {
{JSON.parse(BLOG.FIREWORKS) && <Fireworks/>}
</>
// 延迟加载字体
// 延迟加载fontAwesome
React.useEffect(() => {
loadFont()
loadExternalResource(BLOG.FONT_AWESOME_PATH, 'css')
}, [])
return (
@@ -62,13 +62,4 @@ const MyApp = ({ Component, pageProps }) => {
)
}
/**
* 延迟加载字体
*/
const loadFont = () => {
loadExternalResource(BLOG.FONT_AWESOME_PATH, 'css')
for (const fontUrl of BLOG.CUSTOM_FONT_URL) {
loadExternalResource(fontUrl, 'css')
}
}
export default MyApp