<view>
<canvas style="width:663px;height:663px;" canvas-id="myCanvas"></canvas>
<button data-event-opts="{{[['tap',[['go',['$event']]]]]}}" bindtap="__e">123</button>
</view>
go: function go() {
var ctx = wx.createCanvasContext('myCanvas');
// Create linear gradient
var grd = ctx.createLinearGradient(0, 0, 200, 0);
grd.addColorStop(0, 'red');
grd.addColorStop(1, 'white');
// Fill with gradient
ctx.setFillStyle(grd);
// ctx.fillRect(10, 10, 150, 80)
ctx.fillText("职业", 5, 295);
ctx.draw();
}
https://developers.weixin.qq.com/community/develop/doc/000a2621e648d0064c99e1ab156814?_at=1577955863339
修复中。。。