在select中先绑定change事件
<select name=“type” id=“sel” @change=“changeType”>
username
email
methods: {
changeType: function(){
this.loginType = sel.options[sel.selectedIndex].value;
}
}
要注意的是:在方法中可以直接用select中绑定的id来操作
在select中先绑定change事件
<select name=“type” id=“sel” @change=“changeType”>
username
email
methods: {
changeType: function(){
this.loginType = sel.options[sel.selectedIndex].value;
}
}
要注意的是:在方法中可以直接用select中绑定的id来操作