I’m trying to dynamically change the styles of a component.
In my example that means: I want to receive a prop “color” and then use that in various styles across the component.
Is there any way to do this besides
v-bind:style? (Because I have the feeling that using
:style in so many places would a) duplicate some logic that I’d want to keep in one place by using a CSS class and b) spread the styling around the
<template> where it doesn’t really belong).
So: Did anyone have a similar problem? Is there a sane way to modify the
<style> of a single file component (or another DRY enough approach)?