canvas 通过 <canvas> 标签上的 width 和 height 属性来控制宽高,只需要传入数值,不需要传入单位。使用 css 属性来设置宽高,会出现 canvas 中的内容,被拉伸的问题。