I am practicing Vue and am confused on how to handle data passing. I have a link in my Vue component <a class="btn btn-success" :href="'/projectpage/' + project.id">Bid</a>
Thanks to this question. In my routes web.php I have this route Route::get('/projectpage/{id}', 'ProjectController@projectPage');
. In my ProjectController I have this function
public function projectPage($id){
$project = Project::findOrFail($id);
// return new ProjectResource($project);
return view('project',['project'=>$project]);
}
When I return the ProjectResource it displays the JSON Data and when I return the view, it displays the view and the data that I want to be displayed. I however want to display the data from a vue component. The vue component to fetch the data and then display it on the blade page say like <component></component>
. How do I go about this?