vue Image Upload Component

Rate this post

Today, We want to share with you vue Image Upload Component.In this post we will show you Uploading Files With VueJS and Axios, hear for File Upload in Vue.js Using vue-dropzone we will give you demo and example for implement.In this post, we will learn about File Upload Component with Vue.js, Express and TypeScript with an example.

vue Image Upload Component

There are the Following The simple About vue Image Upload Component Full Information With Example and source code.

As I will cover this Post with live Working example to develop How to upload file in Vue js 2, so the bootstrap vue file upload for this example is following below.

Read Also:  Vuejs File Type extension Validation

Vue.js File Upload

Uploading Files With VueJS and Axios

Step 1: HTML Part

<div id="root">
  <div v-if="!picture">
    <h2>Select an picture</h2>
    <input type="file" @change="onFileChange">
  <div v-else>
    <img :src="picture" />
    <button @click="removeImage">Delete picture</button>

Free Live Chat for Any Issue

Step 2: vuejs part

new Vue({
  el: '#root',
  data: {
    picture: ''
  methods: {
    onFileChange(e) {
      var files = || e.dataTransfer.files;
      if (!files.length)
    createImage(file) {
      var picture = new Image();
      var reader = new FileReader();
      var vm = this;

      reader.onload = (e) => {
        vm.picture =;
    removeImage: function (e) {
      this.picture = '';

Step 3: CSS part

#root {
  text-align: center;
img {
  width: 30%;
  margin: auto;
  display: block;
  margin-bottom: 10px;
button {

Web Programming Tutorials Example with Demo

Read :

Read Also:  10 Useful tools for web developers and designer


You can also read about AngularJS, ASP.NET, VueJs, PHP.


I hope you get an idea about vue Image Upload Component.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.