vue-visual-filter
An unopinionated Vue visual filtering component. It's built with customizability in mind.
Prerequisites
- Node version 12.0.0 or higher.
- NPM.
Installation, and Setting Up The Component
Usage (for both @visual-filter/vue2, and @visual-filter/vue3)
Once you're set up, and ready to start using the component. Reference the component's name in your template:
The filteringOptions
Prop
It contains two options:
data
: An array of objects that stores the data to be filtered. Definition:
methods
: An object that contains the methods to be used to filter the data. Definition:
The filter-update
Event
An event prop that receives a function to be called whenever the filter updates. The function contains one parameter, ctx
, which has in-reactive clones of filter
, and data
objects.
Filter slots
Vue provides a content distribution API called slots. And it's leveraged here to build a custom filter that its elements and styling are provided by you.
Example: