vue中网页图标favicon.ico不显示
1、通过服务器获取在index.html里,添加link,若href是引用服务器上的图片,在不跨域的情况下ok的<link rel="shortcut icon" type="image/x-icon" href="http://img.81lianpin.com/manage/favicon.ico" media="screen" />2、放在本地vue中,需要修改webpack.p
·
1、通过服务器获取
在index.html里,添加link,若href是引用服务器上的图片,在不跨域的情况下ok的
<link rel="shortcut icon" type="image/x-icon" href="http://img.81lianpin.com/manage/favicon.ico" media="screen" />
2、放在本地
vue中,需要修改webpack.prod.conf.js配置,并把favicon.ico放在最外层根目录下
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
hash: timestamp,
favicon: './favicon.ico', //引入favicon.ico
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
},
chunksSortMode: 'dependency'
}),
更多推荐
已为社区贡献5条内容
所有评论(0)