vue 使用input file点击上传本地图片

<input type="file" @change="upData($event)" ref="InputFile" name="files" />
upData(event) {
            var reader = new FileReader();
            let fileData = this.$refs.InputFile.files[0];
            reader.readAsDataURL(fileData);
            let _this=this;
            reader.onload = function(e) {
                console.log(e)
                               // data定义字段
                _this.addimg=e.srcElement.result;
            };
        },