Skip to content

Conversation

brocorp-dev
Copy link

Added AlpineV3 compatibility

Added AlpineV3 compatibility
@brocorp-dev brocorp-dev mentioned this pull request Aug 26, 2021
@SebastianSchoeps
Copy link

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.

@brocorp-dev
Copy link
Author

Hi,

Your fix is currently tested on a staging application, works fine for us... @this directive is correctly converted :

image

@alihassan161820
Copy link

@brocorp-dev when i tried your solution i got this error ( Trying to get property 'id' of non-object )

@iksaku
Copy link

iksaku commented Oct 21, 2021

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.

@Hesesses
Copy link

Hesesses commented Sep 7, 2022

I also got this error: ( Trying to get property 'id' of non-object )

Any other ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants