修改Vue网页标题和图标文档

该文档详细介绍了在Vue项目中修改网页标题和图标的步骤,包括定位到public文件夹,替换favicon.ico文件,以及在index.html中更新标题内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


修改Vue网页标题和图标文档

修改图标

1.找到public文件夹

与src文件同级的文件夹

2.在这个文件夹中找到favicon.ico(这就是页面标题图标文件)

3.把需要修改的文件放到这里面

注意!!!,这里需要时ico文件,可以去网上搜一下转ico文件的在线工具(例如 jpg转ico等)

4.在public文件夹中找到index.html文件

<!DOCTYPE html>
<html lang="">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>agszv-hpysl-001.ico">把这里的ico文件名字换成自己需要的ico文件的名字就可以了
    <title></title>
  </head>
  <body>
    <noscript>
      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>

修改标题

这里也是在public文件夹中找到index.html文件

<!DOCTYPE html>
<html lang="">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>agszv-hpysl-001.ico">
    <title>把这里改成需要修改的标题即可</title>
  </head>
  <body>
    <noscript>
      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>
!-- built files will be auto injected -->
  </body>
</html>

大家也可以关注我的个人博客两边是同步的哦~

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值