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