asantibanez / laravel-blade-sortable

Custom Blade components to add sortable/drag-and-drop HTML elements in your apps.
MIT License
409 stars 79 forks source link

Update scripts.blade.php #11

Open brocorp-dev opened 3 years ago

brocorp-dev commented 3 years ago

Added AlpineV3 compatibility

SebastianSchoeps commented 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.

brocorp-dev commented 3 years ago

Hi,

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

image

alihassan161820 commented 2 years ago

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

iksaku commented 2 years ago

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 commented 2 years ago

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

Any other ideas?