嗨,我无法将 fontawesome 添加到我的 nuxt 应用程序中,我尝试将它添加到 nuxt.config.js 中,但它似乎仍然不起作用。
head: {
title: pkg.name,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/leap-icon.ico' },
{ rel: 'stylesheet', ref: 'https://use.fontawesome.com/releases/v5.2.0/css/all.css' }
]
},Run Code Online (Sandbox Code Playgroud)
Pra*_*ngh 11
下面是在nuxt中实现外部资源的正确方法。
link: [{ rel:"stylesheet", type:"text/css", href:'http://www.example.com/assets/lib/bootstrap/css/bootstrap.min.css' }]
Run Code Online (Sandbox Code Playgroud)
我认为只需更改type为href就可以解决问题。例如
{ rel: 'stylesheet', href: 'https://use.fontawesome.com/releases/v5.2.0/css/all.css' }
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3110 次 |
| 最近记录: |