<template>
<el-container>
<form action="/api/exportExcel">
<input type="text" name="userid">
</form>
<!-- buttonform -->
<button @click="onSubmit"></button>
</el-container>
<template>
<script>
export default {
methods: {
exportExcel () {
document.getElementById("expformsubmit").submit()
}
}
}
</script>
button is placed outside the form. How do I submit events after clicking on this button?
because the result is to action jump after form.submit () to generate the next excel file, ajax is not used.
the above code has been implemented, but if you use vue, you usually refuse to operate with DOM, right? So I want to know the solution based on vue.