[Vuejs]-How to submit a form from another component outside of the form container Vue

3👍

You have to add a ref to the HTML form

<form ref="form">
  <input name="field" v-model="value">
</form>

Then inside your methods you can use the reference to submit the form

methods: {
  send: function(){
    this.$refs.form.submit()
  }
}

and you can call the send method wherever your want.

You can learn more about ref attribute here

https://v3.vuejs.org/guide/component-template-refs.html

Leave a comment