refs #6280 perf: remove deepFind unused code
This commit is contained in:
parent
6809e9bddb
commit
5d888a2977
|
@ -1,5 +1,4 @@
|
|||
<script setup>
|
||||
import { deepFind } from 'src/composables/deepFind';
|
||||
import { ref, toRefs, computed, watch } from 'vue';
|
||||
const emit = defineEmits(['update:modelValue', 'update:options']);
|
||||
|
||||
|
@ -69,7 +68,7 @@ const filter = (val, options) => {
|
|||
return options.filter((row) => {
|
||||
if ($props.filterOptions.length) {
|
||||
return $props.filterOptions.some((prop) => {
|
||||
const propValue = String(deepFind(row,prop)).toLowerCase();
|
||||
const propValue = String(row[prop]).toLowerCase();
|
||||
return propValue.includes(search);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
export async function deepFind(obj, path) {
|
||||
const keys = path.split('.');
|
||||
let current = obj;
|
||||
|
||||
for (const key of keys) {
|
||||
if (current[key] !== undefined) {
|
||||
current = current[key];
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
return current;
|
||||
}
|
Loading…
Reference in New Issue