Hi i'm struggling with this filter not working:
(嗨,我正在努力与此过滤器不起作用:)
export default {
props: {
participants: Array,
},
methods: {
filterUsersByCostCenter() {
this.participants.filter(function (participant) {
return (participant.cost_center == 2);
});
}
}
}
</script>
This is what participants looks like:
(参与者的样子如下:)
participants = [
[0] => {
'name': 'Luca',
'surname': 'Rossi',
'cost_center': 1
}
[1] => {
'name': 'Mario',
'surname': 'Rossi',
'cost_center': 2
}
]
I expect to get only the second index as result but doesn't work
(我希望仅获得第二个索引,但不起作用)
ask by Luca Rossi translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…