Laravel Breeze Vue-链接和页面不渲染



我正在开发一款应用程序,第一次使用Laravel Breeze Vue。只是一些快速的背景,Laravel Breeze为身份验证提供了一些快速的脚手架。当用户登录时,他们会看到一个简单的仪表板页面。我添加了一个新的链接到这个页面如下。

app/resources/js/Layments/Authenticated.vue

<!-- Navigation Links -->
<div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
<BreezeNavLink :href="route('dashboard')" :active="route().current('dashboard')">
Dashboard
</BreezeNavLink>
<BreezeNavLink :href="route('client.index')" :active="route().current('client.index')">
Clients
</BreezeNavLink>
</div>

我还在app/resources/js/Pages/Client/Index.vue文件路径下创建了一个Index.vue文件

<template>
<Head title="Clients" />
<BreezeAuthenticatedLayout>
<template #header>
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
Clients
</h2>
</template>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
You're logged in!
</div>
</div>
</div>
</div>
</BreezeAuthenticatedLayout>
</template>
<script>
import BreezeAuthenticatedLayout from '@/Layouts/Authenticated.vue'
import { Head } from '@inertiajs/inertia-vue3';
export default {
components: {
BreezeAuthenticatedLayout,
Head,
},
}
</script>

我正在使用web.php文件中的路由资源,如下所示。我已经确认client.index是通过php artisan route:list的现有路由。

//client routing
Route::middleware(['auth', 'verified'])->group(function() {
Route::resource('client', ClientController::class);
});

我面临两个问题。第一个问题是该链接不会在我的导航链接中呈现。第二个问题是Index.vue页面也不会呈现。我尝试过执行npm run devnpm run watch和清除缓存。这些都没有奏效。请给我一些关于如何解决这些问题的见解。

此操作已关闭。我使用的是旧硬件,这需要时间来适应变化。CCD_ 4按预期执行。

最新更新