1.0.6 • Published 8 years ago

pastejs v1.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

pastejs

从剪切板中粘贴图片到DOM上,仅支持chrome浏览器

demo


install

npm install pastejs

usage

const Pastejs = require('Pastejs');
const pastejs = new Pastejs({
        isDebug: true,
        target : box,                                   //剪切区域(ID)
        callBack: function(paste){                      //回调,返回blob和剪切图片属性
            console.log(paste);
            document.getElementById("img").src = paste['source'];
            document.getElementById("text").innerHTML = "size:" + paste['blob'].size + "<br>type:" + paste['blob'].type;
        }
    });

License

MIT

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago