I need to include additional inputs for "+ and -" 60mm and 120mm in my function. How can I achieve this without turning all of them into separate functions?
<template>
<card class="card">
<h2>Measurement</h2>
<form>
<div>
<div class="col-md-3">
<base-input type="number" label="Enter measurement:" v-model="measurement"></base-input>
<base-input type="text" label="Subtract 120mm from measurement" v-model="subtracted_measurement_1"></base-input>
<base-input type="text" label="Subtract 60mm from measurement" v-model="subtracted_measurement_2"></base-input>
<base-input type="text" label="Original Measurement:" v-model="original_measurement"></base-input>
<base-input type="text" label="Add 60mm to measurement" v-model="added_measurement_1"></base-input>
<base-input type="text" label="Add 120mm to measurement" v-model="added_measurement_2"></base-input>
</div>
</div>
</form>
</card>
</template>
<script>
import Card from "./Card.vue";
export default {
components: {
Card
},
data() {
return {
measurement: "",
gap: 10,
stone: 60
};
},
computed: {
modifiedMeasurement: function() {
var quantity = this.measurement / 60;
return Math.round(quantity) * 60 - this.gap;
}
}
};
</script>
<style></style>