Hello,
const myData = ref<Array<any>>([]);
const getRulesList = computed(() => {
return store.getRulesGetAll;
});
onMounted(async () => {
await getRules();
myData.value.splice(0, getRulesList.value.length, ...getRulesList.value);
});
const search = ref<string>("");
const searchItems = () => {
getRulesList.value.splice(0, getRulesList.value.length, ...myData.value);
if (search.value !== "") {
let results: Array<any> = [];
for (let j = 0; j < getRulesList.value.length; j++) {
if (searchingFunc(getRulesList.value[j], search.value)) {
results.push(getRulesList.value[j]);
}
}
getRulesList.value.splice(0, getRulesList.value.length, ...results);
}
};
const searchingFunc = (obj: any, value: string): boolean => {
for (let key in obj) {
if (!Number.isInteger(obj[key]) && !(typeof obj[key] === "object")) {
if (obj[key].indexOf(value) != -1) {
return true;
}
}
}
return false;
};
Hi Melih,
Thank you for reaching out to us.
Could you please specify which Metronic version are you using?
Do you have the same issue on our preview page?
https://preview.keenthemes.com/metronic8/vue/demo1/#/dashboard
Regards,
Lauris Stepanovs,
Keenthemes Support Team