Giter Site home page Giter Site logo

yu-img-upload's Introduction

Introduce

this script is just for image upload,it support pc ios and android. in pc & ios you can clear what you picked and repick the pictures;in android you should pick and delete the picture only one by one.

Quick to start

Using npm:

$ npm install --save yu-img-upload
$ import imgUpload from 'yu-img-upload'

Example

You can use npm run dev to check the example file in node package

new imgUpload({
            popup:true,
            multiple:true,
            name:'file',
            target:document.querySelector('.imgUpload'),
            maxnum:6,
            maxsize:0.5,
            accept:'image/gif,image/jpeg,image/jpg,image/png,image/svg',
            hint:'icon',
        });

JSDoc

 * @param {object[]} option
 * @param {boolean} [option[].popup = true] - should it use yu-popup or alert
 * @param {boolean} [option[].multiple = true] - should it accept multiple files
 * @param {string} [option[].name = file] - the name of input
 * @param {obejct} [option[].target = document.querySelector('.imgUpload')] - which dom to render
 * @param {number} [option[].maxnum = 9] - the max number of pictures that can be upload
 * @param {number} [option[].maxsize = 1] - the max size of eeach picture
 * @param {string} [option[].accept = image/gif,image/jpeg,image/jpg,image/png,image/svg] - the format of picture that can be accepted
 * @param {string} [option[].hint = icon] - how  button shows

Links

github npm

yu-img-upload's People

Stargazers

抄起键盘就是CV avatar Zephyr avatar

Watchers

抄起键盘就是CV 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.