SyntaxError: Unexpected token } in Vue js

Viewed 15464

My code is like this :

<multiple-photo-product :product="{{ isset($product) ? $product : '' }}"></multiple-photo-product>

When the code runs it throws an error:

SyntaxError: Unexpected token } in

But if the code is like this:

 <multiple-photo-product product="{{ isset($product) ? $product : '' }}"></multiple-photo-product>

It doesn't throw an error.

I add :, so that the data is sent as an object.

If it does not use :, the data is sent as a string.

How can I solve it?

2 Answers
Related