<canvas
id="cid"
class="cid"
canvas-id="cid"
type="2d"
width="335"
height="375"
></canvas>
document
.querySelector("#cid")
.$$prepare()
.then(domNode => {
console.log(domNode);
const ctx = domNode.getContext("2d");
let bgImg = domNode.$_node.createImage();
bgImg.src =
"https://img1.qdingnet.com/zs_1560313665797.jpg?imageView2/1/w/630/h/370/q/100";
bgImg.onload = () => {
ctx.drawImage(bgImg, 0, 0, 335, 375);
};
});
开发者工具表现:正常
真机标签(ios: 13.5.1 IphoneX):Y轴发生偏移