Vue.js Stoplight app - Dynamically changing classes on elements
You could use the Object Syntax to specify the class bindings instead of the Array Syntax:

&lt;input type='button' id='red' :class='{"btn": true, "btn-danger": (count % 3 === 0)}'  /&gt;


That "btn": true is okay but a little annoying. Luckily "it’s also possible to use the object syntax inside array syntax"1

&lt;input type='button' id='red' :class='["btn", {"btn-danger": (count % 3 === 0)}]'  /&gt;


The documentation uses double quotes and I attempted to use those but it didn't appear to work - perhaps because btn-danger needs to be surrounded by quotes.

&lt;input type='button' id='red' :class="[btn, {'btn-danger': (count % 3 === 0)}]" /&gt;




There doesn't appear to be anything dynamic about the styles in styleObject, so those can be moved out of the business logic and maintained with the other styles in the CSS section. 



The interval function could be simplified using the increment operator:

setInterval(function() {
  app.count++;
}, 1000);




See the rewritten code that utilizes the advice above. 



var app = new Vue({
  el: '#app',
  data: {
    count: 0    
  }
});

setInterval(function() {
  app.count++;
}, 1000);
#light {
  background-color: yellow;
  display: inline-block;
  border: 2px solid black;
  margin: 10px;
  padding: 5px;
}

#light .btn {
  display: block;
  width: 30px;
  margin: 0;
  border-radius: 50px;
  border: 1px solid black;
}
&lt;link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" /&gt;
&lt;script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js"&gt;&lt;/script&gt;
&lt;div id="app"&gt;
  &lt;div id='light'&gt;
    &lt;input type='button' id='red' :class='["btn", {"btn-danger": (count % 3 === 0)}]'  /&gt;
    &lt;br /&gt;
    &lt;input type='button' id='yellow' :class='["btn", {"btn-warning": (count % 3 === 1)}]'  /&gt;
    &lt;br /&gt;
    &lt;input type='button' id='green' :class='["btn", {"btn-success": (count % 3 === 2)}]'  /&gt;
  &lt;/div&gt;
&lt;/div&gt;




1https://vuejs.org/v2/guide/class-and-style.html#Array-Syntax