this is the problem, I need to filter "header" attribute and content at the same time, this is data structure:
const testData = [
{
header: '公众号',
content: [{ name: '系統公告'}],
},
{
header: '我的群聊',
content: [{ name: 'test01'}, { name: '下'}, { name: '公级用户'}],
},
{
header: '上级用户',
content: [{ username: 'root' }],
},
{
header: '下级用户',
content: [{ name: 'test0301'}, { name: '1234'},],
},
];
and if I input something like "下", data should show like this:
const testData = [
{
header: '我的群聊',
content: [{ name: '下'}],
},
{
header: '下级用户',
content: [{ name: 'test0301'}, { name: '1234'},],
},
];
if I input something like "我", data should show like this:
const testData = [
{
header: '我的群聊',
content: [{ name: 'test01'}, { name: '下'}, { name: '公级用户'}],
},
];
i just spend ten hours to think this, but i dont have any ideas......
下, you want content like filter (means do not add other name accept下). but in your second case you need both content other name also. i think you not clear what you want.