Where is the data for boards coming from? I can't see it defined in your script setup.
Inertia Link + V-For Loop not Working.
Hello! I'm not a coder here (This is for a mandatory school project) and English is not my first language. But I would appreciate for some help regarding the issue in my code. I'm following Tallpad's tutorial on Creating a Kanban Board and I'm stuck on creating the Boards List
Mainly on generating the boards as seen at 12:07. I managed to create the static example, but converting it by adding code to them makes it disappear.
I would very much want to use my boards table for rendering lists using v-for and having them hyperlinked by Inertia's Link function. Since InertiaLink isn't working, I had it set to only link. This is the code for the list.
<ul class="grid grid-cols-1 gap-4 sm:grid-cols-3 lg:grid-cols-4">
<li
v-for="board in boards"
:key="board.id"
class="relative bg-yellow-400 hover:bg-yellow-600 rounded-md min-h-[7rem]">
<Link :href="route('boards.show', {board: board.id})"
class="p-3 text-gray-900 hover:text-gray-900 text-lg font-bold absolute inset-0" href="#">
{{ board.name }}
</Link>
</li>
</ul>
I have these at the start of the code of the AuthenticatedLayout:
<script setup>
import { ref } from 'vue';
import ApplicationLogo from '@/Components/ApplicationLogo.vue';
import NavLink from '@/Components/NavLink.vue';
import ResponsiveNavLink from '@/Components/ResponsiveNavLink.vue';
import { Link } from '@inertiajs/vue3';
import {Menu, MenuButton, MenuItem, MenuItems} from '@headlessui/vue';
const showingNavigationDropdown = ref(false);
</script>
The blocks just disappear. and I cant seem to find any solution to this. I really hope to be enlightened in this situation. Thank you! Let me know if I need to provide more details.
The Link functionality works on my AuthenticatedLayout.vue file, so I'm guessing it's more of the V-For? But the tables are running fine. I'm using Sail/Docker with the Latest version of Laravel + Laravel Breeze.
Thank you so much!
Also try to log the boards prop to see if it contains the data you expect by using console.log(props.boards)
const props = defineProps({
boards: Array,
});
console.log(props.boards)
Please or to participate in this conversation.