当前位置:
首页
文章
前端
详情

vue项目添加favicon的几种方式

一、 在public下放置favicon.ico文件

浏览器会自动爬去根目录的 favicon.ico 文件,然后自动呈现

二、在index.html入口文件添加

<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/>

当然也可以添加其他类型的网址图标,如:png图标

<link rel="shortcut icon" type="image/png" href="favicon.png"/>

三、在HtmlWebpackPlugin插件中配置

new HtmlWebpackPlugin({
  filename: 'index.html',
  template: 'index.html',
  inject: true,
  favicon: path.resolve('favicon.ico')
}),

免责申明:本站发布的内容(图片、视频和文字)以转载和分享为主,文章观点不代表本站立场,如涉及侵权请联系站长邮箱:xbc-online@qq.com进行反馈,一经查实,将立刻删除涉嫌侵权内容。