https://github.com/ElemeFE/element http://element.eleme.io/#/en-US/component/upload
<el-upload
class="avatar-uploader"
action="/upload"
:show-file-list="false"
:on-error="handleUrlError"
:on-success="handleUrlSuccess">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
功能:
handleUrlSuccess(response, file, fileList) {
}
如果添加一个额外的参数:
<el-upload
class="avatar-uploader"
action="/upload"
:show-file-list="false"
:on-error="handleUrlError"
:on-success="handleUrlSuccess(response, file, fileList, 233)">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
功能:
handleUrlSuccess(response, file, fileList, param) {
}
属性或方法“响应”未在实例上定义,但在渲染期间引用。