<div id="app11">
<h3>哞哞俩数计算器</h3>
<input type="number" v-model="num1">
<select v-model="chart">
<option value="+">+</option>
<option value="-">-</option>
<option value="×">×</option>
<option value="÷">÷</option>
</select>
<input type="number" v-model="num2">
=
{{ math }}
</div>
<script>
const app11=new Vue({
el:'#app11',
data:{
num1:0,
num2:0,
chart:'+',
answer:0
},
computed:{
math:{
get(){
if(this.chart === '+'){
return this.num1*1 + this.num2*1
}
else if(this.chart === '-'){
return this.num1 - this.num2
}
else if(this.chart === '×'){
return this.num1 * this.num2
}
else if(this.char === '÷'){
return this.num1 / this.num2
}
},
set(){
}
}
}
})
</script>