log-viewer
log-viewer copied to clipboard
No results - Buttons are not working
Versions used :
Log-viewer 3.14.0 - PHP 8.2.25 - Laravel 11.35.1
When :
- I type something in the search bar with no result found
- Two buttons
clear search queryandsearch all filesare displayed - I click on those buttons, but nothing happens
Without any message or error in browser's console
I found the root cause of this issue.
In BaseLogTable.vue, the clearSelectedFile function emits an event:
// BaseLogTable.vue line 165-168
const emit = defineEmits(['clearSelectedFile', 'clearQuery']);
const clearSelectedFile = () => {
emit('clearSelectedFile');
}
However, in the parent component LogList.vue, the
<!-- LogList.vue line 39 -->
<base-log-table />
This means the emitted events are never handled, causing the buttons to appear non-functional. Suggested fix: In LogList.vue, add event handlers:
<base-log-table
@clear-selected-file="fileStore.selectFile(null)"
@clear-query="searchStore.setQuery('')"
/>
Environment: Log Viewer: v3.21.1 Laravel: 12.38.1 PHP: 8.2