I have a data object that contains various groups and rules within each group item. My task is to filter the rules based on a search query, while also displaying the group name associated with the filtered rule.
{
"id": "rulesCompany",
"group": [
{
"name": "Cadastral",
"rule": [
{
"title": "Receita Federal",
"description": "Source updated monthly.",
"homonym": false,
"criticality": "high"
},
{
"title": "Primary CNAE - Alteration",
"description": "Source updated monthly.",
"homonym": false,
"criticality": "high"
}
]
},
{
"name": "Modeled Data",
"rule": [
{
"title": "Activity Level - Alteration",
"description": "Source updated monthly.",
"homonym": false,
"criticality": "high"
},
{
"title": "Presumed Revenue",
"description": "Source updated monthly.",
"homonym": false,
"criticality": "medium"
}
]
}
]
}
For instance, if I search for "Rece" in the search field, I should return the group "Cadastral/Receita Federal". However, I am facing challenges in filtering data nested within the object.
Below is what I've implemented so far:
Module.vue
(pre-formatted code block)Expected Outcome Object when searching for "Rec":
pre-formatted code block