Vue InstantSearch AisPanel & AisRefinementList: how can I find out the number of facets available?

Firstly, thanks for the fantastic library! It has saved us a ton of time with our implementation!

How can I find out how many facets are available inside a AisRefinementList wrapped in a AisPanel so I can hide the entire refinement if only one faceting option is available within it. I’m using the Vue version of the library.

There is the hasRefinements option on AisPanel but it returns true even if there is only one option but I want to hide it if it only has one option.

I also realise items is returned from the AisRefinementList component but I need to access the number of facet items from the AisPanel that wraps my AisRefinementList.

I can see on the vanilla JS version of the library you can hook into a hidden call back and add logic to decide whether to hide or not based on a set number of items - https://support.algolia.com/hc/en-us/articles/4406211114257-InstantSearch-js-How-can-I-hide-a-filter-with-only-one-facet-value-

Any guidance on this is really appreciated! :smile:

1 Like

Hey, @gavin2 – I’m glad you’re enjoying the Vue library! I’ve reached out to a couple of our Vue-focused ambassadors to see if they have any recommendations.

Are you on Discord? We’re in the process of moving our community support over to our new Discord server: Algolia

You may get a faster response there (it’s where our ambassadors hang out).

1 Like

That’s awesome, thanks @chuck.meyer!