I have tried this
<div id="keybrandsapp">
<profile :userdata="'{!! json_encode($user) !!}'"></profile>
</div>
NB: $user is passed from the laravel controller when requesting for profile view that is
public function profile(){
$user = Auth::user();
return \view('user.profile', compact('user', $user));
}
In my profile component(vuejs code)
export default {
props: ['userdata'],
mounted() {
console.dir(this.userdata)
}
}
But this doesnt pass the user data but prints it on the screen.
How do i pass the userdata from laravel blade to vuejs component.
/yourserver.com/userinstead of showing the data on page:userdata="{{json_encode($user)}}