phpMick
333
4
Vue

How to pass an array as a prop?

Posted 1 year ago by phpMick

Is this correct?:

<agreements-selector 
                                           :selected-agreements='{{ json_encode($groupingRule->agreement_ids)}}'>


I'm sure I have done this before and didn't have to use json_encode?

agreement_ids is cast to an array in the model.

Thanks,

Mick

Please sign in or create an account to participate in this conversation.