JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.2.1/vue.js"></script>
<div id="app">
<div class="test" :style="{ height: heightInPixels }">
Hello World {{ heightInPixels }}
</div>
</div>
CSS
.test {
border: 1px solid red;
}
JavaScript
new Vue({
data: {
height: 50
},
created () {
setInterval(() => {
this.height = Math.floor(Math.random() * 300) + 50
}, 2000)
},
computed: {
heightInPixels () {
return this.height + 'px'
},
},
}).$mount('#app')