Open cossack910 opened 12 months ago
idを渡す場合
コントローラ側, 第2引数の配列にidを渡す
public function show($id) {
return Inertia::render('Inertia/Show', [
'id' => $id
]);
}
Vue側(Inertia/Show)
Propsで受け取る
<script setup>
defineProps({
id: String,
});
</script>
<template>
{{ id }}
</template>
Pages配下のInertia/Index.vueをレンダリング
第1引数にコンポーネント、第2引数にプロパティを渡す