1

I'm trying to work out how you can filter a v-for list using checkbox model array where you have multiple checkboxes ticked. Other examples I have found all do the same as my example here - just filter one checkbox at a time. Here is a simple demo of what I have so far - https://jsbin.com/fuzuzucike/1/edit?html,js,console,output as you can checkboxes 1-3 and a list of names.

If you click 1 it filters the name with id1 but then when you click 2 (with 1 still selected) no names appear. I would want names with ids 1 and 2 to show in this case. Am I missing something simple here or is it a case of having to create a custom filter to handle this functionality?

Many thanks.

1 Answer 1

1

Filters are deprecated, use computed properties: https://jsbin.com/jofediqifi/1/edit?html,js,console,output

Sign up to request clarification or add additional context in comments.

1 Comment

That's fantastic thank you! I'd never thought of it that way but it makes total sense.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.