Skip to content

Commit a8dc8a2

Browse files
committed
fix search table column selection
1 parent bd7edd2 commit a8dc8a2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/components/search/SearchResult.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<td>
44
<slot name="checkbox" />
55
</td>
6-
<td v-for="{field: column} in columns" :key="column">
6+
<td v-for="{field: column} in resultColumns" :key="column">
77
<template v-if="column === '_type'">{{ doc[column] }}</template>
88
<template v-else>{{ renderValue(doc, column) }}</template>
99
</td>
@@ -26,17 +26,18 @@
2626

2727
<script setup lang="ts">
2828
import { useTranslation } from '../../composables/i18n.ts'
29-
import { ref } from 'vue'
29+
import { computed, ref } from 'vue'
3030
import RowMenuAction from '../indices/RowMenuAction.vue'
3131
import EditDocument from './EditDocument.vue'
3232
import { useSearchStore } from '../../store/search.ts'
3333
34-
const props = defineProps<{ columns: any[], doc: any }>()
34+
const props = defineProps<{ columns: any[], doc: Record<string, any> }>()
3535
const emit = defineEmits(['reload'])
3636
const t = useTranslation()
3737
3838
const dropdown = ref(false)
3939
const searchStore = useSearchStore()
40+
const resultColumns = computed(() => (props.columns.slice(0, -1)))
4041
4142
const edit = ref(false)
4243
const docInfo = () => ({ index: props.doc._index, type: props.doc._type, id: props.doc._id })

src/components/search/SearchResultsTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
:visible-columns="searchStore.visibleColumns"
5252
selection="multiple"
5353
@request="onRequest">
54-
<template #body="{row}">
55-
<search-result :columns="slicedTableColumns" :doc="row" @reload="reload">
54+
<template #body="{row, cols}">
55+
<search-result :columns="cols" :doc="row" @reload="reload">
5656
<template #checkbox>
5757
<q-checkbox v-model="selectedItems" :val="genDocStr(row)" size="32px"
5858
@update:model-value="setIndeterminate" />

0 commit comments

Comments
 (0)