Skip to content

Commit

Permalink
support alpine lazy load assets
Browse files Browse the repository at this point in the history
  • Loading branch information
smiliyas committed Sep 24, 2024
1 parent bde2332 commit 9ebc0c9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions resources/views/components/turnstile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
<x-dynamic-component :component="$fieldWrapperView" :field="$turnstile">

<div x-data="{
state: $wire.entangle('{{ $statePath }}').defer
state: $wire.entangle('{{ $statePath }}').defer
}"
wire:ignore
x-load-js="['https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback']"
x-init="(() => {
let options= {
callback: function (token) {
Expand Down Expand Up @@ -42,8 +43,6 @@
</div>
</div>

<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback" defer></script>

@push('scripts')
<script>
document.addEventListener('livewire:init', () => {
Expand All @@ -53,4 +52,4 @@
})
</script>
@endpush
</x-dynamic-component>
</x-dynamic-component>

0 comments on commit 9ebc0c9

Please sign in to comment.