我使用 Laravel Inertia 和 React 作为我的应用程序的前端。当我使用 Inertia 的 组件在 React 组件中设置标题时,它会自动将“-Laravel”附加到标题末尾。
<Head>
<title>This is the title</title>
<meta name="description" content="A detailed description of My Page." />
</Head>
问题:
尽管使用 Inertia 的 组件将标题设置为“This is the title”,但页面标题显示为“This is the title - Laravel”。
附加信息:
您应该检查“/resources/js/app.jsx”文件。
最初的配置是:
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
从 VITE_APP_NAME
文件中获取 .env
值。
在您的情况下,可能在
.env
文件中找不到它,默认情况下是“Laravel”