I'm trying to pass into a component, via prop, a color attribute, which will determine the background color of the component. The choices for the color attribute are 'red' and 'blue'.
The actual component is set up as the following:
Vue.component('greeting', {
props: ['color'],
template: '<div v-bind:class="{'add-red': color === 'red', 'add-blue': color === 'blue'}" class="box"></div>'
});
The actual color is passed in as follows:
<component color='red' :is='currentComponent'></component>
But I can't seem to get the class binding to work in my jsfiddle.