@@ -28,7 +28,8 @@ Laravel Telephone Input component for Blade and Livewire based on the [intl-tel-
28
28
- [ Usage] ( #usage )
29
29
- [ Basic usage] ( #basic-usage )
30
30
- [ Add hidden phone-country-input] ( #add-hidden-phone-country-input )
31
- - [ Usage with Livewire] ( #usage-with-livewire )
31
+ - [ Usage with Livewire 2] ( #usage-with-livewire-2 )
32
+ - [ Usage with Livewire 3] ( #usage-with-livewire-3 )
32
33
- [ Sync tel-input wih a country dropdown] ( #sync-tel-input-wih-a-country-dropdown )
33
34
- [ Event Listener] ( #event-listener )
34
35
- [ Props / Attributes] ( #props--attributes )
@@ -151,7 +152,7 @@ Please refer to the [intl-tel-input readme](https://github.com/jackocnr/intl-tel
151
152
/>
152
153
<input type =" hidden" id =" phone_country" name =" phone_country" >
153
154
```
154
- ##### Usage with Livewire
155
+ ##### Usage with Livewire 2
155
156
``` html
156
157
<x-tel-input
157
158
wire:model =" phone"
@@ -161,6 +162,17 @@ Please refer to the [intl-tel-input readme](https://github.com/jackocnr/intl-tel
161
162
/>
162
163
<input wire:model =" phone_country" type =" hidden" id =" phone_country" name =" phone_country" >
163
164
```
165
+ ##### Usage with Livewire 3
166
+ ``` html
167
+ <x-tel-input
168
+ wire:model.live =" phone"
169
+ value =" {{ $phone }}"
170
+ id =" phone"
171
+ name =" phone"
172
+ class =" form-input"
173
+ />
174
+ <input wire:model =" phone_country" type =" hidden" id =" phone_country" name =" phone_country" >
175
+ ```
164
176
##### Sync tel-input wih a country dropdown
165
177
``` html
166
178
<div class =" form-item" >
@@ -246,7 +258,8 @@ input.addEventListener('telchange', function(e) {
246
258
$this->showQuickContactForm = !$this->showQuickContactForm;
247
259
248
260
if ($this->showQuickContactForm) {
249
- $this->dispatchBrowserEvent('telDOMChanged');
261
+ $this->dispatchBrowserEvent('telDOMChanged'); // in Livewire 2
262
+ $this->dispatch('telDOMChanged'); // in Livewire 3
250
263
}
251
264
}
252
265
//...
0 commit comments