微信小程序利用canvas实现六边形蜘蛛图
发布时间:2018-01-24 14:30:29
1、.wxml
<canvas style="width: 200px; height: 200px;" canvas-id="firstCanvas"></canvas>
2、.js
const app = getApp();
Page({
//事件处理函数
canvasIdErrorCallback: function (e) {
console.error(e.detail.errMsg)
},
onReady: function (e) {
hexagon({
element: 'firstCanvas',
x: 100,
y: 100,
maxR: 65,
color: '#ffffff',