vue中上传头像

    inp(e) {
      var fromData = new FormData();
      fromData.append("file", e.target.files[0]);
      axios.defaults.withCredentials = true;
      axios.post("" , fromData, {
          headers: {},
        }).then((res) => {});
    },

你可能感兴趣的:(vue中上传头像)