react-raphael-scrawl
so easy! create scrawl with react-raphael.
Install
# or specify the externals in webpack config
npm install --save raphael
# install react-raphael-scrawl in your react-raphael-scrawl project
npm install --save react-raphael-scrawl
Quickly Start
var React = ;var ReactDOM = ;var Scrawl = ;Component{thisrefsscrawlclear;}{return <div><div><button onClick=thishandleClick>清除画布</button></div><Scrawl ref="scrawl" width=500 height=600 attr="stroke": "#000""stroke-width": 6 /></div>}ReactDOM;
API
All Scrawl Props
- width
number
width of the canvas - height
number
height of the canvas - attr
object
attr of the scrawl path, you can see http://dmitrybaranovskiy.github.io/raphael/reference.html#Element.attr
All Scrawl Ref
- clear
function
clear all scrawl path
Contact
Email: liuhong1.happy@163.com