我正在使用 Vue CLI webpack 模板,但很难加载我自己的 favicon。
我已经运行了vue init webpack my-app
在 index.html
我已经包括:
<link rel="shortcut icon" href="<%= webpackConfig.output.publicPath %>favicon.ico">
...而且我确实看到了默认的 (Vue) 图标。但是,我无法确定该网站图标的位置(或以其他方式引用),也无法确定将自己的网站图标放置在何处以替换它。
我也听从了 this answer 中的建议。 ,这建议将网站图标图像放在
static
文件夹并将其包含在 index.html
中:<link rel="shortcut icon" type="image/png" href="/static/favicon.png"/>
但是,如 promise 的那样,我无法访问我的网站图标。
我的猜测是在 CLI 配置文件中的某处引用了 favicon 位置/文件,但我找不到它。
最佳答案
您可能还需要更新网站图标的 list :/public/manifest.json
.
关于vuejs2 - Vue CLI 图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50778850/