小程序循环传入多个formId

<form @submit="submit" report-submit="true"> <button formType="submit" hover-class="none" data-flag="5"> <button formType="submit" hover-class="none" data-flag="4"> <button formType="submit" hover-class="none" data-flag="3"> <button formType="submit" hover-class="none" data-flag="2"> <button formType="submit" hover-class="none" data-flag="1"> <button formType="submit" hover-class="none" data-flag="0" class="mybtn upload">打卡</button> </button> </button> </button> </button> </button> </form>
export default { data() { return { formId: [] }; },methods: {submit: function(e) { var index = e.detail.target.dataset.flag; this.formId.push(e.detail.formId); console.log(this.formId); if (index == 5) { this.handleUpload(); //这个接口里面把formid的数组传回后台 } },}}

相关文章