Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs favicon反应应用程序不';行不通_Reactjs - Fatal编程技术网

Reactjs favicon反应应用程序不';行不通

Reactjs favicon反应应用程序不';行不通,reactjs,Reactjs,我想在react应用程序中添加favicon,但它似乎不起作用 尝试了以下方法: 将代码添加到head部分的index.html文件中 <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> <link rel="icon

我想在react应用程序中添加favicon,但它似乎不起作用

尝试了以下方法: 将代码添加到head部分的index.html文件中

<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">

<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">

<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">

<link rel="manifest" href="/site.webmanifest">

<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">

<meta name="msapplication-TileColor" content="#ffc40d">

<meta name="theme-color" content="#ffffff">

还将图标与index.html放在同一文件夹中。你能告诉我问题到底出在哪里吗


谢谢。

记住在
index.html

比如,


这应该可以解决您的问题。

对于favicon,请尝试使用ico文件,而不是pngPossible duplicate of可能的副本。在您构建应用程序后,favicon是否在文件夹中?你是否收到一个控制台错误,说它找不到图标?我在控制台上没有看到任何错误…为了测试它是否有效,我将ico文件和其他.png文件放在index.html文件所在的位置。因此,目录结构是folder->app->index.hml和favicon.icoURIError:未能解码参数'/%PUBLIC\u URL%/favicon-32x32.png这是我在控制台中得到的错误。在%PUBLIC\u URL%前面没有“/”