mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-29 07:26:39 +00:00
fix(gui): switching between tabs or closing tab performance issue
- Use a better approach to pass cell(td) element to attachment component Signed-off-by: Pranav C <pranavxc@gmail.com>
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { CellClickHookInj, createEventHook, onBeforeUnmount, onMounted, ref, useSmartsheetStoreOrThrow } from '#imports'
|
||||
|
||||
const { cellRefs } = useSmartsheetStoreOrThrow()
|
||||
import { CellClickHookInj, CurrentCellInj, createEventHook, ref } from '#imports'
|
||||
|
||||
const el = ref<HTMLTableDataCellElement>()
|
||||
|
||||
@@ -9,16 +7,7 @@ const cellClickHook = createEventHook()
|
||||
|
||||
provide(CellClickHookInj, cellClickHook)
|
||||
|
||||
onMounted(() => {
|
||||
cellRefs.value.push(el.value!)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
const index = cellRefs.value.indexOf(el.value!)
|
||||
if (index > -1) {
|
||||
cellRefs.value.splice(index, 1)
|
||||
}
|
||||
})
|
||||
provide(CurrentCellInj, el)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user