vue使用计算属性计算两个input的值
<template>
<div>
<el-input v-model="form.input1"></el-input>
<el-input v-model="form.input2"></el-input>
<el-input v-model="compute"></el-input>
</div>
</template>
<script>
export default{
data(){
return {
form: {
input1: 0,
input2: 0
}
}
},
computed:{
compute(){
return Number(this.form.input1) - Number(this.form.input2);
}
}
}
</script>