0

I am in a project in Laravel 8 but I have a problem in one of the views.

I am also using Livewire for reactivity, for example in the payment view I have created a multi-step or multi-step form that when I click on the continue button it takes me to the next step of the same view with the event wire:click('method'), example:

<button wire:click('nextPage')>
    Continuar
</button>

nextPage () is the method that takes me to the next step, when executing this event everything very well takes me to the next step normally, but the problem is that it disables all the javascript events that are in a script in my layout app.blade.php, this happens at the moment of giving the first click and triggering the wire:click event.

In my app.blade.php I am using a js file as follows:

<script src="{{ asset(js/index.js) }}" defer></script>

I need help with this, thank you very much in advance !!

Carlos
  • 1

1 Answers1

0

the wire directive events like click have an specific format like documentation says:

wire:[dispatched browser event]="[action]"

so, you need to edit your code and write it like

wire:click="nextPage"
Prospero
  • 2,190
  • 2
  • 4
  • 18
  • You mean that instead of writing `wire:click('nextPage')` I have to write it like this `wire:click="nextPage"` ??? – Carlos Aug 28 '21 at 04:18
  • But still putting the correct syntax, it suspends the javascript events that I have in my `index.js` – Carlos Aug 29 '21 at 01:20