<body>
<div id="app">
<input type="text" v-model="num1">
<select v-model="flag">
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
<input type="text" v-model="num2">
<button @click="fn">=</button>
<span>{{result}}</span>
</div>
</body>
<script src="./vue.min.js"></script>
<script>
const vm=new Vue({
el:'#app',
data:{
num1:'',
flag:'+',
num2:'',
result:''
},
methods:{
fn(){
this.result=eval(this.num1+this.flag+this.num2)
}
}
})
</script>