1. 程式人生 > >vue中 element-ui中 submit表單action下載(示例)

vue中 element-ui中 submit表單action下載(示例)

<form name="orderform" style="display:inline-block;" action="http://dev.womaoapp.com/fwas-wishingLamp-admin/sys/wishingOrderRest/orderExportExcel" method="post"> <input v-show="false" style="visiable:hidden;" type="text" name="wishingLampId" v-model="form.wishingLampId"> <
input v-show="false" style="visiable:hidden;" type="text" name="orderNo" v-model="form.orderNo"> <input v-show="false" style="visiable:hidden;" type="text" name="channelId" v-model="form.channelId"> <input v-show="false" style="visiable:hidden;" type="text" name="startTime"
v-model="form.startTime"> <input v-show="false" style="visiable:hidden;" type="text" name="endTime" v-model="form.endTime"> <!-- <input style="height:40px;background:#C8C9CC;border-radius:3px;" @click="daochu" type="button" value="批量匯出" /> --> <el-button
display="inline-block" class="filter-item" type="primary" :loading="downloadLoading" icon="el-icon-download" @click="handleDownload">匯出</el-button> </form>下邊是method中的方法 handleDownload () { document.orderform.submit() },

又綜合看了下  上邊的方法感覺比較low 原生的可能和vue中element-ui中的方法在一塊還是有點低端和格格不入,參考一些資料之後,又重新更新了一篇,參考借鑑。element-ui中下載excel檔案 重新更新方法連結 點選開啟連結