<div id="app">
<select v-model="cur" @change="show">
<option value></option>
<option :value="item.id" v-for="item in arr">{{item.text}}</option>
</select>
<select v-model="cur" @change="show">
<option value></option>
<option :value="item.id" v-for="item in arr2">{{item.text}}</option>
</select>
</div>
var vm = new Vue({
el: "-sharpapp",
data: {
cur: "",
arr:[
{id: 1,text:"hhh"},
{id: 2,text:"xxx"}
],
arr2:[
{id: 3,text:"a3"},
{id: 4,text:"a4"}
]
},
methods: {
show: function() {
console.log(this.cur)
}
}
})
There are two options in the page with one field. After you have done it with vue, select one of them, and both become empty. The effect I want to achieve is to choose one of them, and the other becomes "Please choose". How can it be achieved?