v-file-input
v0.1.3
Published
Simple file input component for Vue.js
Downloads
284
Readme
v-file-input
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>
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