1.0.0 • Published 8 years ago

screenshot-func v1.0.0

Weekly downloads
2
License
MIT
Repository
-
Last release
8 years ago

接入

install

tnpm install screenshot-func

Simple Usage

const screenShot = require('screenshot-func');

class Demo extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
        }
    }
    screenShotHandle(){
        screenShot(document.body).then((canvas) => {
            const imgData = canvas.toDataURL();
            console.log(imgData);
        })
    }
    render() {
        let t = this;
        return <div>
            截图实例
            <button onClick={t.screenShotHandle.bind(t)}>截图</button>
        </div>
    }
};

module.exports = Demo;

Props