npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vuetify-file-uploader

v1.1.1

Published

> This project is built with vue and vuetify > Make sure your project has already vue and vuetify installed

Downloads

10

Readme

This project is built with vue and vuetify Make sure your project has already vue and vuetify installed

Playground

Demo

Quick Start

Install using npm

npm install vuetify-file-uploader 

import component

You can decide for yourself whether to use FileUploader with the layout prop or directly one of the component listed below.

Options 1: register global

import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify'
import FileUploader from 'vuetify-file-uploader'

Vue.config.productionTip = false

Vue.use(FileUploader)

new Vue({
  vuetify,
  render: h => h(App)
}).$mount('#app')

And use it everywhere

<FileUploader></FileUploader>

Options 2: register local

import { FileUploader } from 'vuetify-file-uploader'
export default {
    name: 'app',
    components: {
      FileUploader
    }
}

And use it local

<FileUploader></FileUploader>

Configuration

Components

You can decide for yourself whether to use FileUploader or directly one of the other components. All props listed in the other components can also be passed to FileUploader

FileUploader

Global use

FileUploader can be used out of the box

Local use

import { FileUploader } from 'vuetify-file-uploader'
export default {
  name: 'app',
  components: {
    FileUploader
  }
}
Props

You can also pass all props from the components FileCard, FileCardList and AvatarUploader

| Prop | Type | Default | |--------|--------|---------| | layout | String | "card" |

Slots

Can be passed to FileUploader ,FileCard and FileCardList


<template #title>
  <v-card-title class="white--text"> Another title </v-card-title>
</template>
<template #subtitle>
  <v-card-subtitle class="white--text">Another subtitle</v-card-subtitle>
</template>
Events

| Name | Payload | |---------|------------------------| | addFile | {id, src, file}|

Enums
function layouts() {
  return {
    CARD: "card",
    CARD_LIST: "card-list",
    AVATAR: "avatar",
  };
}

FileCard

Global use

FileCard can be used out of the box

Local use

import { FileCard } from 'vuetify-file-uploader'
export default {
  name: 'app',
  components: {
    FileCard
  }
}
Props

| Prop | Type | Default | Options | |-----------------|------------------|-----------------------------|----------------| | file | Object | null | {id: "",src: "", file: "", imageLazySrc: ""} | | showPlaceholder | Booolean | true | | | imageHeight | String | Number | 200 | | | imageAlt | String | "Picture could not be load" | | | contain | Boolean | false | |

Slots

Can be passed to FileUploader ,FileCard and FileCardList


<template #title>
  <v-card-title class="white--text"> Another title </v-card-title>
</template>
<template #subtitle>
  <v-card-subtitle class="white--text">Another subtitle</v-card-subtitle>
</template>
Events

| Name | Payload | |---------|------------------------| | addFile | {id, src, file}|

FileCardList

Global use

FileCardList can be used out of the box

Local use

import { FileCardList } from 'vuetify-file-uploader'
export default {
  name: 'app',
  components: {
    FileCardList
  }
}
Props

| Prop | Type | Default | Options | Comment | |------------------|------------------|----------|----------------|--------------------------| | file | Object | null | {id: "",src: "", file: "", imageLazySrc: ""}| | | files | Array | null | [{id: "",src: "", file: "", imageLazySrc: ""}] | | | gridCols | String | Number | 6 | | | | showPlaceholder | String | true | | | | imageHeight | String | Number | 200 | | | | allowedFileTypes | String | Array | "image/" | See Common file types | | | maxSize | String | Number | 2048 | | Max file size (Kilobyte) | | contain | Boolean | false | | Image contain crop |

Slots

Can be passed to FileUploader ,FileCard and FileCardList


<template #title>
  <v-card-title class="white--text"> Another title </v-card-title>
</template>
<template #subtitle>
  <v-card-subtitle class="white--text">Another subtitle</v-card-subtitle>
</template>
Events

| Name | Payload | |---------|------------------------| | addFile | {id, src, file}|

Enums
function listLayouts() {
  return {
    GRID: "grid",
  };
}

AvatarUploader

Global use

AvatarUploader can be used out of the box

Local use

import { AvatarUploader } from 'vuetify-file-uploader'
export default {
  name: 'app',
  components: {
    AvatarUploader
  }
}
Props

| Prop | Type | Default | Options | Comment | |------------------|------------------|-----------------------------|-------------------------------------|----------------------------------------------| | file | Object | null | {id: "",src: "", file: "", imageLazySrc: ""} | Set initial file | | minWidth | String | Number | 265 | | Min width of avatar wrapper and image | | minWidth | String | Number | 265 | | Min height of avatar wrapper and image | | color | String | "grey" | | Color in avatar wrapper if no image is given | | imageAlt | String | "Picture could not be load" | | Text shown if the image could not be load | | allowedFileTypes | String | Array | "image/" | See #fileTypes | | | maxSize | String | Number | 2048 | | Max file size (Kilobyte) | | contain | Boolean | false | | Set image contain |

Events

| Name | Payload | |---------|------------------------| | addFile | {id, src, file}|

Helpers

Common file types

If you miss one just google for the content type of you file

function commonFileTypes() {
  return [
    "text/csv",
    "application/msword",
    "image/",
    "image/gif",
    "image/jpeg",
    "text/calendar",
    "application/json",
    "audio/mpeg",
    "video/mp4",
    "video/mpeg",
    "audio/ogg",
    "video/ogg",
    "font/otf",
    "image/png",
    "application/pdf",
    "font/ttf",
    "text/plain",
    "audio/wav",
    "audio/webm",
    "video/webm",
    "image/webp",
    "font/woff",
    "font/woff2",
    "application/zip",
    "video/3gpp",
    "audio/3gpp",
    "video/3gpp2",
    "audio/3gpp2",
    "application/x-7z-compressed",
  ];
};

Dependencies (as peer dependencies)

  • vue
    • 2.6.x
  • vuetify
    • 2.5.x
  • mdi/font
    • 5.9.x

More Coming soon...