Laravel Blade Template Passing Data to Vue JS

I am having trouble passing a property using Vuejs ~ 1.0 to a child component from the Blade Laravel template. If I pass something in plain text, it works fine, but when I try to pass a js property, an array or an object, it doesn't work at all. I currently have a click file with a custom component that looks like this:

<my-component video="@{{ stuff }}"></my-component>

If I leave @{{ }} , then the only thing that will be passed is the string stuff , and if I leave outside @ , I obviously get a blade error, but if I use @{{ stuff }} , then all i get is the string {{ stuff }} . I obviously missed something, but I can’t say where I am wrong. Thanks in advance.

+6
source share
1 answer

Looks like I just figured it out, it seems like I didn't see a colon before the video, so it should have looked like this:

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

I hate it when these little details give you so much time.

+10
source

All Articles