1.0.4 • Published 6 years ago

mobile-graphics v1.0.4

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

mobile-graphics

基于canvas的手写插件(移动端和pc端均可使用)

安装

npm install mobile-graphics --save

使用

const Graphics = require('mobile-graphics');
const graphics = new Graphics({
    el: document.getElementById('canvas'), // 挂载节点
    linewidth: 2,                          // 线条宽度
    color: '#000',                         // 线条颜色
    background: '#fff'                     // 背景颜色
})

参数

{
    el: document.getElementById('canvas'), // 挂载节点(必填)
    linewidth: 2,                          // 线条宽度
    color: '#000',                         // 线条颜色
    background: '#fff'                     // 背景颜色
}

方法

graphics.clear()    // 清空画布
graphics.previous() // 返回上一步
graphics.save()     // 保存画布(该函数会直接返回一个base64)
1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago