Search code examples
vue.jsservernuxt.jsfilepond

FilePond for Vue / Nuxt : Server property set dynamically?


Little question:

<file-pond
  name="customImage"
  ref="pond"
  label-idle="Déposez votre image ici"
  :allow-multiple="false"
  accepted-file-types="image/jpeg, image/png"
  server="http://localhost:3000'"
  :files="custom.customImage"
  @init="handleFilePondInit"
/>

Is it possible to dynamically set the server value ? For example :

v-server="apiUrl+'/api/v1/upload'"

Solution

  • Try this one

    :server="`${apiUrl}/api/v1/upload`"
    

    I'm using :server but it can be written as v-bind:server and ES6 Template literals for some better looking interpolation.