v-file-input

0.1.3 • Public • Published

v-file-input

npm vue2

Simple Vue.js file input component.

Installation

npm install --save v-file-input

Usage

Init with bundler (Webpack, Rollup)

// As plugin
import Vue from 'vue'
import VFileInput from 'v-file-input'

Vue.use(VFileInput)

// As component

Init in browser

<!-- Include after Vue -->
<!-- Local files -->
<script src="v-file-input/dist/v-file-input.js"></script>

<!-- OR -->

<!-- From CDN -->
<script src="https://unpkg.com/v-file-input"></script>

Example

<file-input
    :multiple="true"
    :disabled="false"
    :max-width="200"
    :max-height="200"
    @on-add="addFiles"
    @on-error="showFileApiError"
    @on-drag-start="showDragNotice"
    @on-drag-end="hideDragNotice"
></file-input>

Full example

Development

Launch visual tests

npm run dev

Launch Karma with coverage

npm run dev:coverage

Build

Bundle the js and css of to the dist folder:

npm run build

Publishing

The prepublish hook will ensure dist files are created before publishing. This way you don't need to commit them in your repository.

# Bump the version first
# It'll also commit it and create a tag
npm version
# Push the bumped package and tags
git push --follow-tags
# Ship it 🚀
npm publish

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i v-file-input

Weekly Downloads

80

Version

0.1.3

License

MIT

Unpacked Size

118 kB

Total Files

9

Last publish

Collaborators

  • shrpne