在vue的项目中怎样修改浏览器的 logo 你了解不?
时间:2021-09-09 06:35:13
收藏:0
阅读:15
第一种方案:
在public目录中的index.html
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
图标的位置 public/favicon.ico
第二种方案
在main.js中引入 封装好的 js文件
var link = document.querySelector("link[rel*=‘icon‘]") || document.createElement(‘link‘);
link.type = ‘image/x-icon‘;
link.rel = ‘shortcut icon‘;
link.href = ‘../assets/favicon.ico‘;
document.getElementsByTagName(‘head‘)[0].appendChild(link);
原文:https://www.cnblogs.com/G-Lose/p/15240797.html
评论(0)