1、在stateic下新增favicon.ico文件
2、修改index.html文件,如图
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <link rel="icon" type="image/x-icon" href="https://www.freexyz.cn/dev/static/favicon.ico" rel="external nofollow" > <title>网站名称</title> </head> <body> <div id="app"></div> <!-- built files will be auto injected --> </body> </html>
3、如果有新开页面无法显示图标问题,修改bulid下的webpack.dev.conf.js文件
new HtmlWebpackPlugin({ filename: 'index.html', template: 'index.html', inject: true, favicon:'static/favicon.ico'//新增 }),
4、这个时候再重新启动一次项目就好啦
以上就是Vue 修改网站图标的方法的详细内容,更多关于Vue 修改网站图标的资料请关注其它相关文章!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
评论(0)