.
canvas: measureText 函数与省略号
利用 measureText
可以做 canvas 的省略号功能,代码示例:
1 | const drawText = (text: string, maxWidth: number, x: number, y: number) => { |
.
利用 measureText
可以做 canvas 的省略号功能,代码示例:
1 | const drawText = (text: string, maxWidth: number, x: number, y: number) => { |
Author: Az