0.1.3 • Published 1 year ago

v-file-input v0.1.3

Weekly downloads
179
License
MIT
Repository
github
Last release
1 year ago

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

0.1.3

1 year ago

0.1.2

5 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1

7 years ago