<div class="faceimg">
<img :src="faceImg" alt="">
<input @change="xmTanUploadImg" id="uploadFile" type="file" accept="image/*" mutiple="mutiple" capture="camera">
</div>
xmTanUploadImg(el){
var that = this;
//获取input file的files文件数组;
var fileData = el.target.files[0];
this.fileData = fileData;
//创建用来读取此文件的对象
var reader = new FileReader();
//使用该对象读取file文件
reader.readAsDataURL(fileData);
//读取文件成功后执行的方法函数
reader.onload = function(e) {
//读取成功后返回的一个参数e,整个的一个进度事件
//选择所要显示图片的img,要赋值给img的src就是e中target下result里面
//的base64编码格式的地址
that.faceImg = e.target.result
that.isdisable = false
}
},