How to submit the elementUI form?

as shown in the figure, when the form is defined and clicked on submit, how to quickly get all the name value similar to jQuery serialize, can not define the name value one by one, and then send the request after the object is stitched together?

clipboard.png


  • you can write data in formData when you write data in data, and submit the object directly when you submit it (key with the backend interface)
  • or write action, this.$refs.formName.submit () on form

it is recommended that you take a look at the el-form component in the element-ui document. It is described in detail


A formInline object is bound in el-form in the official website document, which is the final result to be passed.

Menu