LEARNING BY VUEING

Scoped CSS
26 / 42

You can simply add a <style> tag to your Vue component to write CSS.

We declared the class btn which will be available in both App.vue as well as BaseButton.vue.

To make the CSS only apply to its own component add the scoped attribute. Try changing <style> to <style scoped> to see the effects.

It's always recommended to add the scoped attribute and to have traditional global CSS in one place only.