[Vuejs]-How do you style VueJS components?

0👍

If you have created a nav-bar component you can simply assign a class to your custom component for styling like so:

<nav-bar class="my-css-selector"></nav-bar>

This is perfectly legit way to add a selector to your custom element.

0👍

If you use single-file components, you can write CSS just for the component, which they call scoped CSS. Don’t confuse this with the obsolete css scoped attribute; it is a Vue feature.

Leave a comment