怎么用vue实现
可以看一下这个https://blog.csdn.net/m0_62351236/article/details/122405124
upFile () {
// let _this = this
let inputEl = document.createElement("input") //创建上传附件input
inputEl.type = 'file'
inputEl.accept = 'image/*'
inputEl.click() //触发附件上传功能
inputEl.onchange = ()=>{ //监听上传附件change后上传附件;
const file = inputEl.files[0]
console.log(file)
}
}
您好 我想的是在个人头像的字后面显示头像 然后点击这个头像的时候 可以更换头像 谢谢