1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 18:18:53 +08:00

#115 update value when switch row

This commit is contained in:
lana-k
2023-12-26 20:45:11 +01:00
parent 1e982a1196
commit 3aea8c951b
2 changed files with 15 additions and 4 deletions

View File

@@ -78,6 +78,15 @@ export default {
this.selectCell(cell)
}
},
watch: {
currentRowIndex () {
if (this.selectedCellElement) {
const previouslySelected = this.selectedCellElement
this.selectCell(null)
this.selectCell(previouslySelected)
}
}
},
methods: {
onTableKeydown (e) {
const keyCodeMap = {

View File

@@ -13,7 +13,10 @@
<div :id="'run-result-result-set-'+tab.id" class="result-set-container"/>
<template #right-pane v-if="viewValuePanelVisible">
<div class="value-viewer-container">
<value-viewer v-show="selectedCell" :cellValue="selectedCellValue"/>
<value-viewer
v-show="selectedCell"
:cellValue="selectedCell ? selectedCell.innerText : ''"
/>
</div>
</template>
</component>
@@ -41,6 +44,7 @@
:disabled="!result"
tooltip="View record"
tooltip-position="top-left"
:active="viewRecord"
@click="toggleViewRecord"
>
<export-to-csv-icon/>
@@ -50,6 +54,7 @@
:disabled="!result"
tooltip="View value"
tooltip-position="top-left"
:active="viewValuePanelVisible"
@click="toggleViewValuePanel"
>
<clipboard-icon/>
@@ -147,7 +152,6 @@ export default {
dataToCopy: null,
viewValuePanelVisible: false,
selectedCell: null,
selectedCellValue: '',
viewRecord: false,
defaultPage: 1,
defaultSelectedCell: null
@@ -189,7 +193,6 @@ export default {
result () {
this.defaultSelectedCell = null
this.selectedCell = null
this.selectedCellValue = ''
}
},
methods: {
@@ -278,7 +281,6 @@ export default {
onUpdateSelectedCell (e) {
this.selectedCell = e
this.selectedCellValue = this.selectedCell?.innerText
}
}
}