-
前端上传:
<el-upload
class="upload-demo"
drag
action="#"
:headers="headers"
list-type="picture"
accept=".jpg, .jpeg, .png"
:name="name1"
:limit="1"
:file-list="fileList"
:auto-upload="false"
:on-change="change"
:on-preview="handlePreview"
:on-error="handleError"
:before-upload="handleBefore"
style="text-align: center; padding-top:10px;padding-bottom:10px;"
>
<i class="el-icon-upload" />
<div class="el-upload__img">将文件拖到此处,或<em>点击上传</em></div>
</el-upload>
其中重要的选项为 action,:file-list, auto-upload, 以及一些钩子函数
action为要上传的地址,若想不自动上传au