Skip to content

VueFilePreview component should allow raw file data params like VueFileAgent #18

@safrazik

Description

@safrazik

Background: Currently the internal VueFilePreview component accepts only an instance of FileData. It would be better to support raw file data similar to the following:

<template>
  <VueFileAgent v-model="filesData"></VueFileAgent><!-- file upload component with preloaded file data -->
  <VueFilePreview v-model="filesData[0]"></VueFilePreview><!-- single file preview -->
</template>
  export default {
    // ...
    data: function(){
      return {
        filesData: [
           // ...
          {
            "name":"DSC_0261.jpg",
            "lastModified":1564648335292,
            "size":65762,
            "type":"image/jpeg",
            "ext":"jpg",
            "url": "https://safrazik.github.io/vue-file-agent/website/assets/files/DSC_0261.jpg"
          },
          // ...
        ]
      },
      // ...
  };

Example use case by @Garito: Reuse Previews #16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions