Use: Vue, Axios
Interface Requirements: Post method, entry to JSON format, parameter file stream
1. Request function
function (form) { return// send POST request with Axios method: ' Post ', // Request Address // parameter // indicates the type of data returned by the return server Headers: { ' content-type ': ' Application/json ' }}}
2. Export functions
Const PARAMS = { '111}exportexcel (params). Then (res = {//) handles the returned file stream of the const BLOB = new BLOB ([res]); ' statistics. xlsx '; Const Elink = document.createelement (' a '); Elink.download = fileName; ' None '; Elink.href = Url.createobjecturl (BLOB); Document.body.appendChild (Elink); Elink.click (); Url.revokeobjecturl (ELINK.HREF); Release URL object document.body.removeChild (Elink);})
Record, easy to find
Use the Axios processing post method in Vue to export an Excel table (back end returns a file stream)