wire:dirty
Overview
You can use wire:dirty with wire:model to display elements when data properties have been updated on the client side but not the server side.
As the user begins typing in the name or email field, CBWIRE will detect the data properties that have changed on the client side and display a reminder to click submit. After the user clicks submit, the data properties are synchronized, and the reminder is removed.
Removing Elements
You can invert the behavior of wire:dirty by using the .remove modifier:
Targeting Properties
You can target specific data properties using wire:dirty and wire:target.
Toggling Classes
You can toggle classes on elements using wire:dirty.class.
When the user types into the name field, a yellow border is displayed, letting the user know the changes have not been saved.
Last updated