react-canvas-nest

之前在人家网站上看到,我都能玩半个小时。
今天刚好看到了这个插件:react-canvas-nest,用来写写

演示效果

在react环境下使用的

1
2
3
安装:

npm install react-canvas-nest

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
使用代码:

import React from "react";
import ReactCanvasNest from "react-canvas-nest"; //引入

class Home extends React.Component{
render(){
return <ReactCanvasNest
className='canvasNest'
config={{
pointColor: '173, 188, 213 ',
lineColor: '185, 198,219',
lineWidth: 2,
count: 120,
pointR: 1.5
}}
style={{zIndex: 1}}
/>
}
}
export default Home;

效果如下所示:

API

config
config

style
Support style attribute, default style as follows:
style