This commit is contained in:
2024-06-03 07:51:44 +02:00
parent 97ee7d43b8
commit 90318bde75
3 changed files with 86 additions and 10 deletions
+17 -2
View File
@@ -144,7 +144,7 @@ Vue.component('tt-table', {
(column.filter === 'dateRange' ? 'min-width: 260px;' : '') +
(originalColumnWidths[column.key] ? 'width: ' + originalColumnWidths[column.key] + 'px;' : '')"
>
<div style="text-align:center; white-space: nowrap;word-break: keep-all;"
<div style="text-align:center; white-space: nowrap;word-break: keep-all;user-select: none;"
:style="{ 'cursor': column.sortable ? 'pointer' : 'default' }"
@click="column.sortable ? setOrder(column.key) : undefined">
{{ column.text }}
@@ -774,4 +774,19 @@ Vue.component('tt-table', {
beforeDestroy() {
window.removeEventListener('resize', this.debounce(this.handleResponsiveColumns, 100));
}
})
})
Vue.config.errorHandler = function(err, vm, info) {
// still log errors to the console
console.error(info, err, vm);
if (typeof vm.config.key === 'string') {
// check if document.querySelector table.tt-table exists aswell if it has atleast 3 <tr> elements
const table = document.querySelector('table.tt-table');
if (!table || !table.querySelectorAll('tr').length > 2) {
// localStorage.removeItem(`tt-table-${vm.config.key}`);
// window.location.reload();
}
}
}