JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<div id="app">
<button v-on:click="startProgress">Start Progress</button>
<br><br>
<div class="progress" :style="{width : progressWidth + 'px'}"></div>
</div>
CSS
.progress{
background-color: pink;
transition: all 310ms ease;
width: 0px;
height: 20px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
JavaScript
new Vue({
el: '#app',
data: {
progressWidth : 0
},
methods: {
startProgress : function(){
var vm = this;
setInterval(function(){
vm.progressWidth+=10;
}, 150);
vm.progressWidth= 20 ? console.log('20') : console.log('--');
}
},
});