Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

afoysal's avatar

Filter in PROPS in vue.js

I have code like below

created () {
     EventBus.$on('change',this.formated);
},
props: ['applicants',],
data() {
        return {
            values: [],
      }
},
methods : {
        formated (item) {
         //some code here
        }
}

I have some checkboxes in another component. I am trying to catch values of those checkboxes in this component. After catching those values I would like to filter the props applicants. I would like to find out which applicants have those values of checkboxes. Then I would like to pass them to values[]. Then I would like to iterate those values in HTML.

0 likes
3 replies
bobbybouwmann's avatar

What have you tried so far? It sounds to me that you just need to loop over that array and compare the two. What is not working for you?

1 like
afoysal's avatar

Thanks @bobbybouwmann for your reply. My props from one component, EventBus is coming from another component and I am working on a 3rd component. That's why I need to work with props. I have to work with props inside method and created. Thanks a lot.

Please or to participate in this conversation.