@script
<script>
Livewire.hook('component.init', ({
component,
cleanup
}) => {
if (component.name == 'app.filament.pages.brf-revenue-page') {
inserthead()
}
})
Livewire.hook('request', ({
uri,
options,
payload,
respond,
succeed,
fail
}) => {
inserthead()
})
function inserthead() {
console.log('test');
setTimeout(function() {
const thead = document.querySelector("thead");
const newHTML = '<tr class="bg-gray-50 dark:bg-white/5">test</tr>';
thead.insertAdjacentHTML('afterbegin', newHTML);
}, 1500);
}
</script>
@endscriptwrite javascript for Livewire
by
Tags:
Leave a Reply