Open brocorp-dev opened 3 years ago
Are you sure this works? For @this
to work you must be in the component's context, which is not the case if you add the script to your layouts.blade.php
e.g.
Hi,
Your fix is currently tested on a staging application, works fine for us... @this directive is correctly converted :
@brocorp-dev when i tried your solution i got this error ( Trying to get property 'id' of non-object )
Since this is an Alpine component, you may test for this.$wire
instead of manually looking for the closest livewire component, or using @this
, which is supposed to work in component context only and is not meant for reusable functions like this.
I also got this error: ( Trying to get property 'id' of non-object )
Any other ideas?
Added AlpineV3 compatibility