title: How is the most simples way to convert input[type=file] into a string base64 in Vue (with javascript)?
body: <p><strong>I want to generate a string base64 with a input type=file to persist just the string base64 so that became easier to manage images in database. Easier because i can work with only Json in this way.</strong></p>
  
  <blockquote>
    <p>I have something like this in my Vue server (using bootstrap-vue):</p>
  </blockquote>
  
  <pre><code>&lt;template&gt;
  &lt;div class="row"&gt;
      &lt;!-- Send Image --&gt;
    &lt;div class="col-sm-8 ml-auto mr-auto"&gt;
      &lt;b-form-file v-model="file" :state="Boolean(file)" placeholder="Escolha uma imagem..." accept="image/*"&gt;&lt;/b-form-file&gt;
      &lt;b-button v-on:clicl="submitFile()"&gt;Enviar&lt;/b-button&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;/template&gt;
  
  export default {
    name: 'imagem',
    data(){
      return{
        file: ''
  
      }
    },
    methods:{
        submitFile () {
            let stringBase64 = wantToConvertFile(this.file);
        }
    }
  }
  </code></pre>
  
  <blockquote>
    <p>So how is the simple way to make sometring similar of
    "wantToConvertFile( )"?</p>
  </blockquote>
  
  <p><a href="https://bootstrap-vue.js.org/docs/components/form-file/" rel="nofollow noreferrer">Bootstrap-VUE - Form File Input</a></p>