方法: 在与src同级的public文件夹中添加favico.ico文件,在与src同级的index.html文件添加代码如下所示: <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> 之后刷新页面即可显示。