commit | author | age | ||
f7d0ce | 1 | @props(['on']) |
F | 2 | |
3 | <div x-data="{ shown: false, timeout: null }" | |
4 | x-init="@this.on('{{ $on }}', () => { clearTimeout(timeout); shown = true; timeout = setTimeout(() => { shown = false }, 2000); })" | |
5 | x-show.transition.out.opacity.duration.1500ms="shown" | |
6 | x-transition:leave.opacity.duration.1500ms | |
7 | style="display: none;" | |
8 | {{ $attributes->merge(['class' => 'text-sm text-gray-600']) }}> | |
9 | {{ $slot->isEmpty() ? 'Saved.' : $slot }} | |
10 | </div> |