为什么我写了渐变 代码如下
context = uni.createCanvasContext('canvas');
context.beginPath(0)
context.arc(x, y, 5, 0, Math.PI * 2)
const gg = context.createLinearGradient(0,0,0,6)
gg.addColorStop(0,'red')
gg.addColorStop(1,'white')
context.setFillStyle(gg)
context.setStrokeStyle('rgba(1,1,1,0)')
context.fill()
context.stroke()
或是
ball = uni.createCanvasContext('canvas')
const grd = ball.createLinearGradient(0, 0, 200, 0)
grd.addColorStop(0, 'red')
grd.addColorStop(1, 'white')
// Fill with gradient
ball.setFillStyle(grd)
ball.fillRect(10, 10, 150, 80)
ball.draw()
产生的结果就是报错了???
报错 :::
index.umd.min.js:1 [system] errorHandler TypeError: t.toLowerCase is not a function
at g (index.umd.min.js:1)
at t.setFillStyle (index.umd.min.js:1)
at VueComponent.drawBalloon (index.vue:259)
at VueComponent.mounted (index.vue:288)
at invokeWithErrorHandling
sdonly
现在也还有这个问题。微信小程序运行正常;安卓端报这个错
2021-07-02 15:23
sdonly
没有做渐变,简简单单画个圈,渲染几个文字。还是出现这样的问题
2021-07-02 15:24