Laravel Blade Template passing data to Vue JS component Laravel Blade Template passing data to Vue JS component vue.js vue.js

Laravel Blade Template passing data to Vue JS component


Look like I just figured it out, it seems that I was missing the colon before video, so it should have appeared like so:

<my-component :video="stuff"></my-component>


If you are passing a variable to the component, then use:

<my-component :video= "{{ json_encode($stuff) }}" ></my-component>

Don't forget the double quotes or the result would be unpredictable for things like objects.


If you are passing model then do this:

<my-component :video="{{ $stuff->toJson() }}" inline-template></my-component>