Git Product home page Git Product logo

vue-img-inputer's Introduction

Features

  • Support Pic preview/drop-select/max-size
  • Two themes

Brief

Just like a <input type="file"/>

Support

Vue 2.0+

Develop

// develop
npm start

// build
npm run build

Install & Useage

npm install vue-img-inputer -D
  • As global component
// in entry file
import Vue from 'vue'
import VueImgInputer from 'vue-img-inputer'
Vue.component('VueImgInputer', VueImgInputer)
  • As partial component
// in some component
import VueImgInputer from 'vue-img-inputer'
export default {
  components: {
    VueImgInputer
  }
}

Sample

<VueImgInputer v-model="picValue" theme="light" size="large"></VueImgInputer>

Props

Name Type Description Optional value Default
v-model the file was selected
accept String the same as accept in input,suggest to set a specific value like image/jpg,image/gif;, value as image/* will cause a problem that File-checkbox come out after a long time image/*,video/*;
onChange Function callback trigger after file selected,params: {file, fileName}
placeholder String placeholder 点击或拖拽选择图片
maxSize Number max-size of pic (KB) 5120
imgSrc String use VueImgInputer as img tag, you should assign a src of img :)
id String input's unique ID,assign it when you need to operate DOM, otherwise it will automatic generate a random string in 4 length to be it's ID random string in 4 length
theme String theme light,material material
size String size small,large normal
icon String icon img,clip,img2 clip,when theme is light, default is img
readonly Boolean readonly,it will be true while imgSrc was not empty false
bottomText String text in the bottom while select a pic && hover component 点击或拖拽图片以修改
readonlyTipText String only when readonly was true was effective,replace bottomText 不可更改
customerIcon like &#xe624; if you use iconfont of alibaba,Congratulations! you can use this prop set any value to replace component's own icon
noMask Boolean remove info mask while hover false
nhe Boolean no-hover-effect false
name String name of input, the same as name in input - file

Compatibility

PC: IE10 +

Mobile: be happy to use

vue-img-inputer's People

Contributors

waynecz avatar sinchang avatar wayne-mai avatar

Watchers

undefined avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.