input 上传文件
HTML
<input type="file" ref="fileInput" @change="upload"
accept="application/vnd.ms-excel,application/vnd.ms-excel"/>
js
upload(){
const fileInput = this.$refs.fileInput
const file = fileInput.files[0]
const formData = new FormData()
formData.append('file', file)
this.axios.post('api/order/upload', formData).then(response => {
alert(response.data)
this.getOrderList();
})
}