子域离屏canvas画不到主域上
// src/myOpenDataContext/index.js let sharedCanvas = wx.getSharedCanvas(); let context = sharedCanvas.getContext( "2d" ); context.fillStyle = "#fff" ; context.fillRect(0, 0, 100, 100); context.fillText( "获取的数据" , 0, 0); |
//game.js let openDataContext = wx.getOpenDataContext(); let sharedCanvas = openDataContext.canvas; let canvas = wx.createCanvas(); let context = canvas.getContext( "2d" ); context.drawImage(sharedCanvas, 0, 0); // new Main(); |
我想让开放域上的离屏canvas在主域上显示,但是完全没效果,全部是黑色,这是为什么