Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scripts.blade.php #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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