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

jandante's avatar

Custom Filter Age Slider

Hi,

I'm experimenting with Vue.js and I want to filter an array of profiles based on a range slider.

I've created a jsfiddle that demonstrates the basic idea => https://jsfiddle.net/bstewz4m/2/

The range slider is linked to two hidden inputs (minAge & maxAge) and onChange of the slider the change event of the hidden inputs gets triggered. That way I can bind the input to v-model and as you can see in the fiddle it is working. Sliding the range slider gives new values for minAge en maxAge.

But now I want my array profiles to be filtered based on those values + i want that filter to be applied every time the range slider changes. I'm not quite sure if I'm going for the correct approach but I would suppose to add a custom filter.

Can someone point me out if that is indeed the correct way of handling this + maybe point me to how to implement this?

Thanks in advance!

0 likes
2 replies

Please or to participate in this conversation.