Skip to content

Commit 931e6cc

Browse files
committed
fix: exposed dsIndexes through provide
1 parent 000970a commit 931e6cc

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/Dataset.vue

+9-8
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ export default {
5353
/**
5454
* @param {{
5555
* dsData: Record<string, any>[];
56-
* dsFilterFields: { [fieldId in string]: (cellValue: any) => boolean | any };
56+
* dsFilterFields: { [fieldId in string]: (columnValue: any) => boolean | any };
5757
* dsSortby: string[];
5858
* dsSearchIn: string[];
59-
* dsSearchAs: { [id in string]: (cellValue: any, searchString: string) => boolean };
60-
* dsSortAs: { [id in string]: (cellValue: any) => any };
59+
* dsSearchAs: { [id in string]: (columnValue: any, searchString: string) => boolean };
60+
* dsSortAs: { [id in string]: (columnValue: any) => any };
6161
* }} props
6262
*/
6363
setup(props) {
6464
const dsPage = ref(1)
6565
const dsSearch = ref('')
6666
const dsShowEntries = ref(10)
6767
const datasetI18n = ref(i18n)
68-
const indexes = ref([])
68+
const dsIndexes = ref([])
6969
7070
const search = (value) => {
7171
dsSearch.value = value
@@ -98,15 +98,15 @@ export default {
9898
})
9999
100100
const dsRows = computed(() => {
101-
return indexes.value.slice(dsFrom.value, dsTo.value)
101+
return dsIndexes.value.slice(dsFrom.value, dsTo.value)
102102
})
103103
104104
const dsPages = computed(() => {
105105
return createPagingRange(dsPagecount.value, dsPage.value)
106106
})
107107
108108
const dsResultsNumber = computed(() => {
109-
return indexes.value.length
109+
return dsIndexes.value.length
110110
})
111111
112112
const dsPagecount = computed(() => {
@@ -156,13 +156,14 @@ export default {
156156
// We need only the indexes
157157
result = result.map((entry) => entry.index)
158158
}
159-
indexes.value = result
159+
dsIndexes.value = result
160160
},
161161
{
162162
immediate: true
163163
}
164164
)
165165
166+
provide('dsIndexes', dsIndexes)
166167
provide('search', search)
167168
provide('showEntries', showEntries)
168169
provide('setActive', setActive)
@@ -180,7 +181,7 @@ export default {
180181
provide('dsPage', dsPage)
181182
182183
return {
183-
dsIndexes: indexes,
184+
dsIndexes,
184185
dsShowEntries,
185186
dsResultsNumber,
186187
dsPage,

0 commit comments

Comments
 (0)