jeudi 27 septembre 2018

Can't pass associative array to vue

I have array like this.

$array = ['a' => 1, 'b' => 2];

I want to pass it to Vue But it can not.

<my-component :array="'{!! json_encode($array) !!}'"
></my-component>

But the output is show like this in html.

":1,"b":2}'"="">



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2zyn0Px
via IFTTT

Aucun commentaire:

Enregistrer un commentaire