03 Vue修改浏览器显示图标及标题

zp1207 / 2024-10-22 / 原文

1.准备png图片

准备一张png图片,拷贝到public文件夹中。

2.替换默认图标和标题

打开src目录下的index.html文件,修改head节点下的link中设置准备的图片,在title中设置标题即可。

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="shortcut icon" type="image/x-icon" href="./public/xxx.png" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>自定义标题</title>
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="/src/main.ts"></script>
  </body>
</html>