https://www.sunzhongwei.com/how-to-get-input-value-in-vuejs
使用ref
<input id="number" type="number" v-model="seat" ref="input">
this.result = this.$refs.input.value
这里的seat
是怎么来的?
this.getParams()
getParams() {
// 取到路由带过来的参数
this.seat = this.$route.query.seat
console.log(this.seat)
},
是在登录页面表单提交传过来的
this.$router.push({
path: '/main',
query: {
seat: this.loginForm.seat,
tel: this.loginForm.tel
}
})