Closed Mrchen128 closed 2 years ago
group.addShape('image', { attrs: { x: 8 - w / 2, y: 8 - h / 2, width: 24, height: 24, img: 'https://g.alicdn.com/cm-design/arms-trace/1.0.155/styles/armsTrace/images/TAIR.png', }, name: 'image-shape', }); 这段代码会报 TypeError: Cannot read property 'createImage' of undefined的错误,求解答
初始化Graph的时候,记得传入container,值是canvas实例
参考: https://github.com/antvis/F6/blob/d5b43ba3aec84ad84f8ba5e05217601e050f64d6/packages/examples-wx/package-elements/pages/elements/circle/index.js#L61
参考:
https://github.com/antvis/F6/blob/d5b43ba3aec84ad84f8ba5e05217601e050f64d6/packages/examples-wx/package-elements/pages/elements/circle/index.js#L61
感谢解答,可以了
group.addShape('image', { attrs: { x: 8 - w / 2, y: 8 - h / 2, width: 24, height: 24, img: 'https://g.alicdn.com/cm-design/arms-trace/1.0.155/styles/armsTrace/images/TAIR.png', }, name: 'image-shape', }); 这段代码会报 TypeError: Cannot read property 'createImage' of undefined的错误,求解答