<div x-data="counter">
<h1 x-text="count"></h1>
</div>
@script
<script>
Alpine.data('counter', () => {
return {
count: {{$record->tempo_max}},
init() {
setInterval(() => {
--this.count;
if(this.count == 0) {
$wire.timer_ko();
}
}, 1000);
},
}
})
</script>
@endscript
<div x-data="counter">
<h1 x-text="count"></h1>
</div>
@script
<script>
Alpine.data('counter', () => {
return {
count: {{$record->tempo_max}},
init() {
setInterval(() => {
--this.count;
if(this.count == 0) {
$wire.timer_ko();
}
}, 1000);
},
}
})
</script>
@endscript