Using value from parent livewire component in ViewField
I've added a form to a custom livewire component. The form contains a
ViewField
, and within that view I need to check the value of one of my livewire component's props. I can't just do $complete
, that gives an undefined error. If I pass the value in with ->viewData(['complete' => $this->complete])
it works the first time but it's not reactive, when complete
changes the view is not updated. Any ideas?5 Replies
OK this works:
I think You can pass in a closure too:
Sadly not:
Ok try it on view instead?
or on the form I think you can pass the closure in returning the array
I\ve done it one second
Ok I did it with a section component and did
notice the closure in schema
Ah OK, will give that a go, thanks!