How to submit a form in Vue, redirect to a new route and pass the parameters?

前端 未结 3 1149
终归单人心
终归单人心 2021-02-05 04:52

I am using Nuxt and Vue and I am trying to submit a form, redirect the user to a new route including the submitted params, send an API request to get some data and then render t

3条回答
  •  清酒与你
    2021-02-05 05:51

     submitClick(){
            this.$router.push({path: '/search', query:{key: value}})
        }
    This is the right way to achieve a SPA with form submit. it supports enter key and in submitClick, there can be any logic before submitting

提交回复
热议问题