laravel-blade-sortable icon indicating copy to clipboard operation
laravel-blade-sortable copied to clipboard

Update scripts.blade.php

Open brocorp-dev opened this issue 3 years ago • 5 comments

Added AlpineV3 compatibility

brocorp-dev avatar Aug 26 '21 06:08 brocorp-dev

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.

SebastianSchoeps avatar Aug 26 '21 08:08 SebastianSchoeps

Hi,

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

image

brocorp-dev avatar Aug 26 '21 10:08 brocorp-dev

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

alihassan161820 avatar Sep 28 '21 21:09 alihassan161820

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.

iksaku avatar Oct 21 '21 19:10 iksaku

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

Any other ideas?

Hesesses avatar Sep 07 '22 15:09 Hesesses