vue中添加title中的小图标


webpack.prod.conf.js 这个文件中:
引入代码const path = require('path') ;下面是进行配置: 
new HtmlWebpackPlugin({ 
    filename: config.build.index, 
    template: 'index.html', 
    favicon: path.resolve('./favicon.ico'), 
    inject: true, 
}), 

webpack.prod.dev.js这个文件中:
引入代码:const path = require('path') ; 下面是进行配置: 
new HtmlWebpackPlugin({ 
    filename: 'index.html',
    template: 'index.html',
    favicon: path.resolve('./favicon.ico'), 
    inject: true, 
}), 

  

最后很关键的index.html中的代码引入:

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

  


免责声明!

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



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