解决Vue项目中favicon图标无法正常显示方法


方法一:

  1.将favicon.ico文件存放到项目根路径下;

  2.配置webpack.dev.conf.js

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

  1.将favicon.ico文件存放到static文件夹下;

  2.配置webpack.dev.conf.js

     new HtmlWebpackPlugin({
      filename: 'index.html',
      template: 'index.html',
      favicon:'static/favicon.ico',
      inject: true
    })
 
 
方法三:
  图片文件有缓存,清除缓存


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM