<el-upload
action=""
:limit="1"
:on-change="handleChange"
:auto-upload="false"
:file-list="fileList"
:show-file-list="false"
>
<span>选择文件</span>
</el-upload>
export default {
data() {
return {};
},
methods: {
// 选择文件
handleChange(file, fileLists) {
console.log(file);
console.log(fileLists);
// 本地服务器路径
console.log(URL.createObjectURL(file.raw));
// 本地电脑路径
console.log(document.getElementsByClassName("el-upload__input")[0].value);
},
},
};
网友评论