Error: ctx.measureText is not a function

发布于 7 年前作者 xiulan686833 次浏览最后编辑 7 年前来自 ask

按钮官方的这个DEMO怎么提示:TypeError: ctx.measureText is not a function?


const ctx = wx.createCanvasContext('myCanvas')

ctx.font = 'italic bold 20px cursive'const metrics = ctx.measureText('Hello World')console.log(metrics.width)
1 回复
wchang
wchang1 楼5 年前

你的基础库版本是多少呢?