mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 19:08:20 +00:00
Add Selection Prop
This commit is contained in:
parent
a7446d9663
commit
234ad792d1
1 changed files with 5 additions and 2 deletions
|
@ -15,15 +15,18 @@ const props = defineModel<{
|
||||||
sortSelf?: boolean,
|
sortSelf?: boolean,
|
||||||
sortBy?: string,
|
sortBy?: string,
|
||||||
sortDesc?: boolean,
|
sortDesc?: boolean,
|
||||||
|
selection?: number[],
|
||||||
}>();
|
}>();
|
||||||
let { columns, data, sort, sortSelf, sortBy, sortDesc } = $(props);
|
let { columns, data, sort, sortSelf, sortBy, sortDesc, selection } = $(props);
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: 'rowAction', index: number): void,
|
(event: 'rowAction', index: number): void,
|
||||||
(event: 'selectionChanged'): void
|
(event: 'selectionChanged'): void
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
let selection = $ref([] as number[]);
|
if (selection == undefined) {
|
||||||
|
selection = [];
|
||||||
|
}
|
||||||
|
|
||||||
const displayData = $computed(() => (sortSelf && sortBy !== '')
|
const displayData = $computed(() => (sortSelf && sortBy !== '')
|
||||||
? data?.sort((a, b) => {
|
? data?.sort((a, b) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue