Skip to content

Commit 1c1c37d

Browse files
Add custom search function property to DataSet
1 parent 405efff commit 1c1c37d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Dataset.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ export default {
6767
dsSortAs: {
6868
type: Object,
6969
default: () => ({})
70+
},
71+
dsSearchFc: {
72+
type: Function,
73+
default: function () {
74+
return (searchVal) => {
75+
return (entry) => { return findAny(this.dsSearchIn, this.dsSearchAs, entry.value, searchVal) }
76+
}
77+
}
7078
}
7179
},
7280
data: function () {
@@ -157,7 +165,7 @@ export default {
157165
158166
// Search it
159167
if (dsSearch) {
160-
result = result.filter((entry) => findAny(dsSearchIn, dsSearchAs, entry.value, dsSearch))
168+
result = result.filter(this.dsSearchFc(dsSearch));
161169
}
162170
163171
// Sort it

0 commit comments

Comments
 (0)