mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
fix: reactivity problem on BaseVirtualScroll component
This commit is contained in:
@ -118,7 +118,7 @@
|
|||||||
"better-sqlite3": "~7.5.0",
|
"better-sqlite3": "~7.5.0",
|
||||||
"electron-log": "~4.4.1",
|
"electron-log": "~4.4.1",
|
||||||
"electron-store": "~8.0.1",
|
"electron-store": "~8.0.1",
|
||||||
"electron-updater": "~5.0.1",
|
"electron-updater": "~4.6.5",
|
||||||
"electron-window-state": "~5.0.3",
|
"electron-window-state": "~5.0.3",
|
||||||
"encoding": "~0.1.13",
|
"encoding": "~0.1.13",
|
||||||
"leaflet": "~1.7.1",
|
"leaflet": "~1.7.1",
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import * as fs from 'fs';
|
||||||
import * as antares from 'common/interfaces/antares';
|
import * as antares from 'common/interfaces/antares';
|
||||||
import { InsertRowsParams } from 'common/interfaces/tableApis';
|
import { InsertRowsParams } from 'common/interfaces/tableApis';
|
||||||
import { ipcMain } from 'electron';
|
import { ipcMain } from 'electron';
|
||||||
@ -5,8 +6,7 @@ import { faker } from '@faker-js/faker';
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { sqlEscaper } from 'common/libs/sqlEscaper';
|
import { sqlEscaper } from 'common/libs/sqlEscaper';
|
||||||
import { TEXT, LONG_TEXT, ARRAY, TEXT_SEARCH, NUMBER, FLOAT, BLOB, BIT, DATE, DATETIME } from 'common/fieldTypes';
|
import { TEXT, LONG_TEXT, ARRAY, TEXT_SEARCH, NUMBER, FLOAT, BLOB, BIT, DATE, DATETIME } from 'common/fieldTypes';
|
||||||
import * as customizations from 'common/customizations';
|
import customizations from 'common/customizations';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
export default (connections: {[key: string]: antares.Client}) => {
|
export default (connections: {[key: string]: antares.Client}) => {
|
||||||
ipcMain.handle('get-table-columns', async (event, params) => {
|
ipcMain.handle('get-table-columns', async (event, params) => {
|
||||||
|
@ -40,7 +40,6 @@ const bottomHeight: Ref<number> = ref(0);
|
|||||||
const visibleItems: Ref<any[]> = ref([]);
|
const visibleItems: Ref<any[]> = ref([]);
|
||||||
const renderTimeout: Ref<NodeJS.Timeout> = ref(null);
|
const renderTimeout: Ref<NodeJS.Timeout> = ref(null);
|
||||||
const localScrollElement: Ref<HTMLDivElement> = ref(null);
|
const localScrollElement: Ref<HTMLDivElement> = ref(null);
|
||||||
const scrollElement = ref(props.scrollElement);
|
|
||||||
|
|
||||||
const checkScrollPosition = () => {
|
const checkScrollPosition = () => {
|
||||||
clearTimeout(renderTimeout.value);
|
clearTimeout(renderTimeout.value);
|
||||||
@ -72,12 +71,12 @@ const setScrollElement = () => {
|
|||||||
if (localScrollElement.value)
|
if (localScrollElement.value)
|
||||||
localScrollElement.value.removeEventListener('scroll', checkScrollPosition);
|
localScrollElement.value.removeEventListener('scroll', checkScrollPosition);
|
||||||
|
|
||||||
localScrollElement.value = scrollElement.value ? scrollElement.value : root.value;
|
localScrollElement.value = props.scrollElement ? props.scrollElement : root.value;
|
||||||
updateWindow();
|
updateWindow();
|
||||||
localScrollElement.value.addEventListener('scroll', checkScrollPosition);
|
localScrollElement.value.addEventListener('scroll', checkScrollPosition);
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(scrollElement, () => {
|
watch(() => props.scrollElement, () => {
|
||||||
setScrollElement();
|
setScrollElement();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user