New Sep 19, 2024

How to apply classes to the checkboxes that are rendered in a buefy b-table when checkable is set to true?

Libraries, Frameworks, etc. All from Newest questions tagged vue.js - Stack Overflow View How to apply classes to the checkboxes that are rendered in a buefy b-table when checkable is set to true? on stackoverflow.com

I have a buefy b-table component and I'm trying to style the checkboxes to match the rest of my project by applying classes to them. Since I am not actually creating/rendering the element, how do I access it to apply the class?

I tried using:

checkboxType= "my-custom-class"

But that didn't work. I tried accessing the checkboxes via refs after they were rendered and adding classes like this:

this.$nextTick(() =>{
               const checkboxes = this.$refs.tableComponent.$el.querySelectorAll('input[type="checkbox"]');
               checkboxes.forEach(checkbox => {
                   checkbox.classList.add('my-custom-class');
               })
           })

Any advice is appreciated!

Scroll to top