1、<input type="file" class="picImg" name="imgFile" ref="headerImageInput" value="修改头像" @change="changImg" id="in">
2、method:{
changImg() {
let headerImageInput = this.$refs.headerImageInput;
let params = {
name: headerImageInput.name,
file: headerImageInput.files[0]
};
console.log( headerImageInput.files[0],'hdfjsh')
let successCallback = data => {
this.$emit("showData");
};
this.$store.dispatch({ type: "updataImg", params, successCallback });
},
}