Improve livewire performance with Defer

This commit is contained in:
David Bomba 2022-09-30 19:47:27 +10:00
parent 8dbf1b238f
commit c69a979291
2 changed files with 3 additions and 3 deletions

View File

@ -233,7 +233,7 @@
@csrf
<label class="w-full mr-2">
<input type="text" wire:model.lazy="coupon" class="input w-full m-0"/>
<input type="text" wire:model.defer="coupon" class="input w-full m-0"/>
</label>
<button class="button button-primary bg-primary">{{ ctrans('texts.apply') }}</button>

View File

@ -15,7 +15,7 @@
@if(!array_key_exists('filled', $field))
@component('portal.ninja2020.components.general.card-element', ['title' => $field['label']])
@if($field['name'] == 'client_country_id' || $field['name'] == 'client_shipping_country_id')
<select id="client_country" class="input w-full form-select bg-white" name="{{ $field['name'] }}" wire:model.lazy="{{ str_replace(["client_","_line_","contact_"], ["client.","","contact."], $field['name']) }}">
<select id="client_country" class="input w-full form-select bg-white" name="{{ $field['name'] }}" wire:model.defer="{{ str_replace(["client_","_line_","contact_"], ["client.","","contact."], $field['name']) }}">
<option value="none"></option>
@foreach($countries as $country)
@ -25,7 +25,7 @@
@endforeach
</select>
@else
<input class="input w-full" type="{{ $field['type'] ?? 'text' }}" name="{{ $field['name'] }}" wire:model.lazy="{{ str_replace(["client_","_line_","contact_"], ["client.","","contact."], $field['name']) }}">
<input class="input w-full" type="{{ $field['type'] ?? 'text' }}" name="{{ $field['name'] }}" wire:model.defer="{{ str_replace(["client_","_line_","contact_"], ["client.","","contact."], $field['name']) }}">
@endif
@if(session()->has('validation_errors') && array_key_exists($field['name'], session('validation_errors')))