Vue
by Владимир Коротенко
HTML
<div id="app">
<h2>Расчет скорости:</h2>
<ol>
<li><label>D:</label><input v-model="diameter"></li>
<li><label>RPM:</label><input v-model="rpm"></li>
<li><label>Radial speed:</label>{{ getRadialSpeed.toFixed(3) }} М/c</li>
</ol>
</div>
CSS
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
#app {
background: #fff;
border-radius: 4px;
padding: 20px;
transition: all 0.2s;
}
li {
margin: 8px 0;
}
li > label{
width: 150px;
display: inline-block;
}
h2 {
font-weight: bold;
margin-bottom: 15px;
}
del {
color: rgba(0, 0, 0, 0.3);
}
Vue
new Vue({
el: "#app",
data: {
diameter: 75,
rpm: 55000,
},
computed: {
getRadialSpeed: function(){
return (this.diameter * Math.PI * (this.rpm / 60 )) / 1000;
}
}
})