<div id="app"> <button :class="['btn', isError ? 'btn-danger' : 'btn-success']" @click="isError = !isError">Submit</button> </div>
var vue = new Vue({ el: "#app", data: { isError: false } });
This Pen is owned by Darío Rivera on CodePen.
See more by @fermius on CodePen