input框接收一个传过来的值,编辑以后获取

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
      }
})

猜你喜欢

转载自blog.csdn.net/fengtingYan/article/details/88529241
今日推荐