I am building a tool to calculate how much it would cost to buy certain material. The problem is that sometimes the user buys it either by mass or volume.
I would like a way to have two active inputs (mass and volume) and each automatically updates considering the material density.
I tried computed properties and watchers but couldn't make it work properly.
Here is what I'd like it to look like and what I tried https://jsfiddle.net/yfuk958j/
Mass = <input v-model.number="mass"> <br/>
Volume = <input v-model.number="volume"><br/>
computed: {
volume() {
return this.mass * this.density
},
mass () {
return this.volume / this.density
}
}