DEV Community

Discussion on: Creating a dynamic (Active tabs) menu in Vuejs ✨

Collapse
 
patryktech profile image
Patryk

Also, it's no big deal since we're not destroying/creating the element in the DOM all over again. Since this is not a function or variable it's a minor thing to override it!

I'm not so worried about performance as breaking other functionality.

Admittedly, I don't think I've ever used a <span/> inside a menu before, but I might want to, one day* (e.g. for e-commerce, add a <span class="category-discount">-15%</span> to the Shoes menu).

If you set <span/>s to display: none, you might have to use something like <span class="category-discount" style="display: inline-block !important">-15%</span>, or another override to your override.

I always try to work on as specific selectors as possible, and only add what is needed.

*Maybe a case of YAGNI and overthinking :)