1、通过服务器获取
在index.html里,添加link,若href是引用服务器上的图片,在不跨域的情况下ok的
<link rel="shortcut icon" type="image/x-icon" href="/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.icominify: {removeComments: true,collapseWhitespace: true,removeAttributeQuotes: true},chunksSortMode: 'dependency'}),