mount() is not working on Field component
I think I'm doing something wrong, even though I put the data, I can't get it on the view side.
14 Replies
use viewData() on the field? But as you are using livewire and doing it your way with livewire you access public properties with {{ $record}} and {{$testing}}
Thanks for reply, i fixed listing problem but mount() is not running, i see "before" text on field, im using mount() wrong ?
Field isn’t a livewire component so mount won’t have any effect.
Thanks for information 🍀
How can i maniuple $variable like a mount() function on Field ?
i try viewData is not working, not triggering
what are you trying to do
maybe use setUp() instead of mount()
that runs when the field is instantiated
i have Field component, i want get media data and list on field view
how to pass custom variable on view like $media on field component?
SetUp() is worked
Thanks for helping again!
🍀
Sorry for asking too many questions, i cannot inject record on Field, how to inject ? record is null
it isnt available there
all public methods on your Field class are available inside the view.
public function getMedia()
can be called as $getMedia()
from the view
return your media from there, you can access $this->getRecord()
from those public methodsI understand now, thank you very much